aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
Commit message (Collapse)AuthorAge
* allow configuring the escape delay timeoutGravatar Kurtis Rader2016-01-17
| | | | | | | | Introduce a "fish_escape_delay_ms" variable to allow the user to configure the delay used when seeing a bare escape before assuming no other characters will be received that might match a bound character sequence. This is primarily useful for vi mode so that a bare escape character (i.e., keystroke) can switch to vi "insert" to "normal" mode in a timely fashion.
* improve handling of the escape characterGravatar Kurtis Rader2015-12-22
| | | | | | | | | | | | | | | Increase the delay between seeing an escape character and giving up on whether additional characters that match a key binding are seen. I'm setting the value to 500 ms to match the readline library. We don't need such a large window for sequences transmitted by a terminal (even over ssh where network delays can be a problem). However, we can't expect humans to reliably press the escape key followed by another key with an inter-char delay of less than ~250 ms based on my testing and research. A value of 500 ms provides a nice experience even for people using "fish_vi_mode" bindings as a half second to switch from insert to normal mode is still fast enough that most people won't even notice. Resolves #1356
* Shave 4 bytes from parse_node_tGravatar ridiculousfish2015-12-19
| | | | Bitfields ftw
* Don't define a function if there's an error in function's argsGravatar ridiculousfish2015-12-19
| | | | Fixes #2519
* Allow and/or statements to attach to the if/while headerGravatar ridiculousfish2015-12-19
| | | | | | | | | | For example: if false; or true; echo hello; end will output 'hello' now. Fixes #1428
* Simplify parser implementationGravatar ridiculousfish2015-12-19
| | | | | | | | Rather than returning a list of productions and an index, return the relevant production directly from the rule function. Also introduce a tag value (replacing production_idx) which tracks information like command decorations, etc. with more clarity.
* detect and provide fallback for backtrace_symbols_fdGravatar David Adam2015-12-17
| | | | Closes #2615 to fix includes on FreeBSD and provide fallback on Cygwin.
* restore the terminal modes before an "exec"Gravatar Kurtis Rader2015-12-15
| | | | | | | | | When replacing the existing fish process with a new process it is important to restore the temrinal modes to what they were when fish started running. We don't want any tweaks done for the benefit of fish (e.g., disabling ICRNL mode) to bleed thru to an "exec"ed command. Resolves #2609
* Check that $XDG_RUNTIME_DIR is valid and accessibleGravatar Tanner Bruce2015-12-11
| | | | Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au>
* Remove a stale comment regarding fishdGravatar ridiculousfish2015-12-10
|
* Switch show_stackframe to backtrace_symbols_fdGravatar Andy Lutomirski2015-12-10
| | | | | It's simpler and avoids calling into fprintf in contexts in which it might crash or deadlock.
* Don't complain if do_builtin_io fails due to EPIPEGravatar Andy Lutomirski2015-12-10
| | | | | | | If stdio is dead due to EPIPE, there's no great reason to spew a stack dump. This will still write an error to stderr if stdout dies. This might be undesirable, but changing that should be considered separately.
* Ensure interactive tty modes are set ASAPGravatar Kurtis Rader2015-12-08
| | | | | | | | | It is critical that we ensure our interactive tty modes are in effect at the earliest possible moment. This achieves that goal and is harmless if stdin is not tied to a tty. The reason for doing this is to ensure that \r characters are not converted to \n if we're running on the slave side of a pty controlled by a program like tmux that is stuffing keystrokes into the pty before we issue our first prompt.
* allow \cJ (\n) to be bound separate from \cM (\r)Gravatar Kurtis Rader2015-12-08
| | | | | | | This makes it possible (on UNIX systems, don't know about MS Windows) to bind \cJ (\n) independently of \cM (\r, aka [enter]). Resolves #217
* named_color_names to reserve the right amountGravatar ridiculousfish2015-12-08
|
* "normal" should appear in set_color --print-colorsGravatar Kurtis Rader2015-12-08
|
* remove "normal" from the basic color name tableGravatar Kurtis Rader2015-12-08
| | | | | | The special token "normal" should not be in the basic sixteen color table because a) it is not a color, and b) it is special cased with the result of resetting the terminal colors (usually via a ANSI X3.64 CSI [0m sequence).
* add support for ANSI "bright" colorsGravatar Kurtis Rader2015-12-08
| | | | | | | | | | | | | | This adds support for the ANSI x3.64 "bright" colors in the basic sixteen color palette. This is especially useful when trying to use the base colors as a background color. The "bright" variants tend to be more useful as background colors compared to the non-bright variants. This also fixes a bug in so far as palette number 7 is actually grey and not white whereas palette number 15 is white. At least on the terminal emulators on which I've tested this change (Ubuntu xterm & uxterm, Mac OS X Terminal & iTerm2). Resolves issue #1464.
* Don't print the jobs header when stdout is redirectedGravatar ridiculousfish2015-12-03
|
* Fix the error message not being outputedGravatar Max Nordlund2015-12-03
|
* Fix wrong exit code for `jobs` #2505Gravatar Max Nordlund2015-12-03
|
* env_universal_common.cpp: don't bother trying nonexistent pathGravatar David Adam2015-11-28
|
* env.cpp: warn when wgetcwd() failsGravatar David Adam2015-11-28
| | | | Closes #2321
* fish_tests.cpp: use temporary path for completion testsGravatar David Adam2015-11-27
| | | | Closes #2322
* Fix tab completion after '%' character.Gravatar Daniel Matz2015-11-27
|
* Attempt to fix the sporadic uvar test failures on LinuxGravatar ridiculousfish2015-11-08
| | | | | | | | | | | | | | | | | | We identify when the universal variable file has changed out from under us by comparing a bunch of fields from its stat: inode, device, size, high-precision timestamp, generation. Linux aggressively reuses inodes, and the size may be the same by coincidence (which is the case in the tests). Also, Linux officially has nanosecond precision, but in practice it seems to only uses millisecond precision for storing mtimes. Thus if there are three or more updates within a millisecond, every field we check may be the same, and we are vulnerable to the ABA problem. I believe this explains the occasional test failures. The solution is to manually set the nanosecond field of the mtime timestamp to something unlikely to be duplicated, like a random number, or better yet, the current time (with nanosecond precision). This is more in the spirit of the timestamp, and it means we're around a million times less likely to collide. This seems to fix the tests.
* Make input_mapping_execute stop returning R_NULL too oftenGravatar ridiculousfish2015-11-07
| | | | | | | | | | input_mapping_execute, when passed false for allow_commands, will return R_NULL. However currently it does this unconditionally, even if we don't have any commands. This defeats our read-ahead optimization, so we always read and process one byte at a time. This caused pasting to be much slower. Fixes #2215
* Teach the cd autosuggestion how to descend "unique" hierarchiesGravatar ridiculousfish2015-11-07
| | | | | | | | If we are cd'ing into a directory, and the directory has only one child which is itself a directory, the autosuggestion should descend as far as it can. Fixes #2531
* Make 'set -ql' search up to function scopeGravatar ridiculousfish2015-10-23
| | | | | | | | | | | | | Previously 'set -ql' would only look for variables in the immediate local scope. This was not very useful. It's also arguably surprising, since a 'set -l' in a function, followed by a 'set -ql' in a child block, would fail. There was also no way to check for a function-scoped variable, since omitting the scope would also pull in global variables. We could revisit this and introduce an explicit function scope. Fixes #2502
* Revert "reader.cpp: send carriage return after printing the window title"Gravatar ridiculousfish2015-10-21
| | | | | This fix introduced #2499 This reverts commit 13479fbc2a130d97caeb66f7f56fb89c6be8c489.
* reader.cpp: send carriage return after printing the window titleGravatar David Adam2015-10-16
| | | | | | | Terminals can get confused by all the non-printed characters about the line position. Closes #2453.
* Fix usage of history_filenameGravatar Jeff Kowalski2015-10-16
|
* Migrate fish_history from config to data dirGravatar Jeff Kowalski2015-10-16
| | | | | | | | | New implementation of migration code within the history_t class will copy the contents of the old fish_history found in the config directory to its new location in the data directory. The old file is left intact. This is done only in the event that a fish_history is not already found in the data directory ($XDG_DATA_HOME/fish or ~/.local/share/fish).
* Correct tests for new location of fish_historyGravatar Jeff Kowalski2015-10-16
| | | | | | | | The fish_history file is now located in the "data" directory ($XDG_DATA_HOME/fish or ~/.local/share/fish), accessible using the function `path_get_data`. (This commit also cleans trailing whitespace in the source file.)
* Access fish_history from $XDG_DATA_HOMEGravatar Jeff Kowalski2015-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new functions path_get_data and path_create_data which parallel existing functions path_get_config and path_create_data. The new functions refer to XDG_DATA_HOME, if it is defined, or ./local/share if not. Modify history_filename to use the new function path_get_data. As a consequence, fish_history will now be located in XDG_DATA_HOME, not XDG_CONFIG_HOME. Note that these changes mirror what is already used in fish-shell/share/tools/create_manpage_completions.py, which stores the completions in XDG_DATA_HOME This change matches recommendations in the xdg basedir spec at http://standards.freedesktop.org/basedir-spec/basedir-spec-0.7.html ($XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.) It addresses suggestions from the following issues: 1. Don't put history in $XDG_CONFIG_HOME (closes #744) https://github.com/fish-shell/fish-shell/issues/744 2. Fish is placing non-config files in $XDG_CONFIG_HOME #1257 https://github.com/fish-shell/fish-shell/issues/1257 3. Move non-config data out of $XDG_CONFIG_HOME #1669 https://github.com/fish-shell/fish-shell/issues/1669
* Revert "reader.cpp: send smkx/rmkx when entering/leaving interactive mode"Gravatar David Adam2015-10-15
| | | | | | | This reverts commit a66d44054c4aae44c307b10bb10469b4565e5027 due to https://github.com/fish-shell/fish-shell/issues/2406 - entering keypad mode causes various terminals to send undocumented and highly variable escapes for keys not specified in the terminfo specification.
* When autoloading a completion, also autoload the functionGravatar ridiculousfish2015-10-07
| | | | | Fixes a case where a --wraps declaration would be missed because the function would not be loaded. Fixes #2466.
* Fix a dereference-past-the-end bug in read_redirection_or_fd_pipeGravatar ridiculousfish2015-10-07
| | | | Fixes #2464. Credit to zanchey for reporting it and ASAN for finding it!
* Don't do intermediate fuzzy directory matching with $PATHGravatar ridiculousfish2015-10-03
| | | | | When expanding an executable with $PATH, don't attempt to interpret the directories in PATH as fuzzy matching. Fixes #2413.
* Only include <spawn.h> if HAVE_SPAWN_HGravatar Fredrik Fornwall2015-10-02
| | | | | | | This fixes building on platforms such as Android which lacks <spawn.h>. Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au>
* Generate version numbers for Xcode buildsGravatar Ian Ray2015-09-29
| | | | | | | | | | | | Teach Xcode to run new script xcode_version_gen.sh before building the fish_shell and fish_indent targets. The script generates file fish-build-version.h for inclusion by fish_version.cpp. Note that Xcode always runs the script because of the phony target named force-fish-build-version.h, but fish-build-version.h is only touched if the contents of FISH-BUILD-VERSION-FILE change. Fixes #890
* Fix a typoGravatar ridiculousfish2015-09-27
|
* Fix for recursive wildcard expansion ignoring directoriesGravatar ridiculousfish2015-09-27
| | | | | When ascending out of a directory, we need to clear the directory from the visited set. Fixes #2414.
* Trailing slashes in wildcards need to match directoriesGravatar ridiculousfish2015-09-27
| | | | Fixes the wrong sense in a waccess test.
* Maintain ownership when rewriting universal variables fileGravatar ridiculousfish2015-09-26
| | | | Fixes #2176
* Preserve existing file permissions when rewriting a history fileGravatar ridiculousfish2015-09-26
| | | | Fixes #2335
* Teach builtin_string to recognize redirections, not just pipesGravatar ridiculousfish2015-09-25
| | | | | Allows cases like `string split \n < file.txt` to work. Fixes 2422
* Prefix errors with 'string:', not 'string string:'Gravatar Michael Steed2015-09-24
|
* Eliminate global variables associated with builtin IOGravatar ridiculousfish2015-09-22
| | | | | | | This change eliminates global variables like stdout_buffer. Instead we wrap up the IO information into a new struct io_streams_t, and thread that through every builtin. This makes the intent clearer, gives us a place to hang new IO data, and eliminates the ugly global state management like builtin_push_io.
* Apply some care regarding overflow in `string sub`Gravatar ridiculousfish2015-09-21
|