Fish Shell Versions Save

The user-friendly command line shell.

3.4.0

2 years ago

Notable improvements and fixes

  • fish’s command substitution syntax has been extended: $(cmd) now has the same meaning as (cmd) but it can be used inside double quotes, to prevent line splitting of the results (#159):
foo (bar | string collect)
# can now be written as
foo "$(bar)"

# and

foo (bar)
# can now be written as
foo $(bar)
# this will still split on newlines only.
  • Complementing the prompt command in 3.3.0, fish_config gained a theme subcommand to show and pick from the sample themes (meaning color schemes) directly in the terminal, instead of having to open a Web browser. For example fish_config theme choose Nord loads the Nord theme in the current session (#8132). The current theme can be saved with fish_config theme dump, and custom themes can be added by saving them in ~/.config/fish/themes/.
  • set and read learned a new option, --function, to set a variable in the function’s top scope. This should be a more familiar way of scoping variables and avoids issues with --local, which is actually block-scoped (#565, #8145):
function demonstration
    if true
        set --function foo bar
        set --local baz banana
    end
    echo $foo # prints "bar" because $foo is still valid
    echo $baz # prints nothing because $baz went out of scope
end
  • string pad now excludes escape sequences like colors that fish knows about, and a new --visible flag to string length makes it use that kind of visible width. This is useful to get the number of terminal cells an already colored string would occupy, like in a prompt. (#8182, #7784, #4012):
> string length --visible (set_color red)foo
3
  • Performance improvements to globbing, especially on systems using glibc. In some cases (large directories with files with many numbers in the names) this almost halves the time taken to expand the glob.
  • Autosuggestions can now be turned off by setting $fish_autosuggestion_enabled to 0, and (almost) all highlighting can be turned off by choosing the new “None” theme. The exception is necessary colors, like those which distinguish autosuggestions from the actual command line. (#8376)
  • The fish_git_prompt function, which is included in the default prompts, now overrides git to avoid running commands set by per-repository configuration. This avoids a potential security issue in some circumstances, and has been assigned CVE-2022-20001 (#8589).

Deprecations and removed features

  • A new feature flag, ampersand-nobg-in-token makes & only act as background operator if followed by a separator. In combination with qmark-noglob, this allows entering most URLs at the command line without quoting or escaping (#7991). For example:
> echo foo&bar # will print "foo&bar", instead of running "echo foo" in the background and executing "bar"
> echo foo & bar # will still run "echo foo" in the background and then run "bar"
# with both ampersand-nobg-in-token and qmark-noglob, this argument has no special characters anymore
> open https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be

As a reminder, feature flags can be set on startup with fish --features ampersand-nobg-in-token,qmark-noglob or with a universal variable called fish_features:

> set -Ua fish_features ampersand-nobg-in-token
  • $status is now forbidden as a command, to prevent a surprisingly common error among new users: Running if $status (#8171). This applies only to $status, other variables are still allowed.
  • set --query now returns an exit status of 255 if given no variable names. This means if set -q $foo will not enter the if-block if $foo is empty or unset. To restore the previous behavior, use if not set -q foo; or set -q $foo - but this is unlikely to be desireable (#8214).
  • _ is now a reserved keyword (#8342).
  • The special input functions delete-or-exit, nextd-or-forward-word and prevd-or-backward-word replace fish functions of the same names (#8538).
  • Mac OS X 10.9 is no longer supported. The minimum Mac version is now 10.10 “Yosemite.”

Scripting improvements

  • string collect supports a new --allow-empty option, which will output one empty argument in a command substitution that has no output (#8054). This allows commands like test -n (echo -n | string collect --allow-empty) to work more reliably. Note this can also be written as test -n "$(echo -n)" (see above).
  • string match gained a --groups-only option, which makes it only output capturing groups, excluding the full match. This allows string match to do simple transformations (#6056):
> string match -r --groups-only '(.*)fish' 'catfish' 'twofish' 'blue fish' | string escape
cat
two
'blue '
  • $fish_user_paths is now automatically deduplicated to fix a common user error of appending to it in config.fish when it is universal (#8117). fish_add_path remains the recommended way to add to $PATH.
  • return can now be used outside functions. In scripts, it does the same thing as exit. In interactive mode,it sets $status without exiting (#8148).
  • An oversight prevented all syntax checks from running on commands given to fish -c (#8171). This includes checks such as exec not being allowed in a pipeline, and $$ not being a valid variable. Generally, another error was generated anyway.
  • fish_indent now correctly reformats tokens that end with a backslash followed by a newline (#8197).
  • commandline gained an --is-valid option to check if the command line is syntactically valid and complete. This allows basic implementation of transient prompts (#8142).
  • commandline gained a --paging-full-mode option to check if the pager is showing all the possible lines (no “7 more rows” message) (#8485).
  • List expansion correctly reports an error when used with all zero indexes (#8213).
  • Running fish with a directory instead of a script as argument (eg fish .) no longer leads to an infinite loop. Instead it errors out immediately (#8258)
  • Some error messages occuring after fork, like “text file busy” have been replaced by bespoke error messages for fish (like “File is currently open for writing”). This also restores error messages with current glibc versions that removed sys_errlist (#8234, #4183).
  • The realpath builtin now also squashes leading slashes with the --no-symlinks option (#8281).
  • When trying to cd to a dangling (broken) symbolic link, fish will print an error noting that the target is a broken link (#8264).
  • On MacOS terminals that are not granted permissions to access a folder, cd would print a spurious “rotten symlink” error, which has been corrected to “permission denied” (#8264).
  • Since fish 3.0, for loops would trigger a variable handler function before the loop was entered. As the variable had not actually changed or been set, this was a spurious event and has been removed (#8384).
  • math now correctly prints negative values and values larger than 2\*\*31 when in hex or octal bases (#8417).
  • dirs always produces an exit status of 0, instead of sometimes returning 1 (#8211).
  • cd "" no longer crashes fish (#8147).
  • set --query can now query whether a variable is a path variable via --path or --unpath (#8494).
  • Tilde characters (~) produced by custom completions are no longer escaped when applied to the command line, making it easier to use the output of a recursive complete -C in completion scripts (#4570).
  • set --show reports when a variable is read-only (#8179).
  • Erasing $fish_emoji_width will reset fish to the default guessed emoji width (#8274).
  • The la function no longer lists entries for “.” and “..”, matching other systems defaults (#8519).
  • abbr -q returns the correct exit status when given multiple abbreviation names as arguments (#8431).
  • command -v returns an exit status of 127 instead of 1 if no command was found (#8547).
  • argparse with --ignore-unknown no longer breaks with multiple unknown options in a short option group (#8637).
  • Comments inside command substitutions or brackets now correctly ignore parentheses, quotes, and brackets (#7866, #8022, #8695).
  • complete -C supports a new --escape option, which turns on escaping in returned completion strings (#3469).
  • Invalid byte or unicode escapes like \\Utest or \\xNotHex are now a tokenizer error instead of causing the token to be truncated (#8545).

Interactive improvements

  • Vi mode cursors are now set properly after Control-C (#8125).
  • funced will try to edit the whole file containing a function definition, if there is one (#391).
  • Running a command line consisting of just spaces now deletes an ephemeral (starting with space) history item again (#8232).
  • Command substitutions no longer respect job control, instead running inside fish’s own process group (#8172). This more closely matches other shells, and improves Control-C reliability inside a command substitution.
  • history and __fish_print_help now properly support less before version 530, including the version that ships with macOS. (#8157).
  • help now knows which section is in which document again (#8245).
  • fish’s highlighter will now color options (starting with - or --) with the color given in the new $fish_color_option, up to the first --. It falls back on $fish_color_param, so nothing changes for existing setups (#8292).
  • When executing a command, abbreviations are no longer expanded when the cursor is separated from the command by spaces, making it easier to suppress abbreviation expansion of commands without arguments. (#8423).
  • fish_key_reader’s output was simplified. By default, it now only prints a bind statement. The previous per-character timing information can be seen with a new --verbose switch (#8467).
  • Custom completions are now also loaded for commands that contain tildes or variables like ~/bin/fish or $PWD/fish (#8442).
  • Command lines spanning multiple lines will not be overwritten by the completion pager when it fills the entire terminal (#8509, #8405).
  • When redrawing a multiline prompt, the old prompt is now properly cleared (#8163).
  • Interactive completion would occasionally ignore the last word on the command line due to a race condition. This has been fixed (#8175).
  • Propagation of universal variables from a fish process that is closing is faster (#8209).
  • The command line is drawn in the correct place if the prompt ends with a newline (#8298).
  • history learned a new subcommand clear-session to erase all history from the current session (#5791).
  • Pressing Control-C in fish_key_reader will no longer print the incorrect “Press [ctrl-C] again to exit” message (#8510).
  • The default command-not-found handler for Fedora/PackageKit now passes the whole command line, allowing for functionality such as running the suggested command directly (#8579).
  • When looking for locale information, the Debian configuration is now used when available (#8557).
  • Pasting text containing quotes from the clipboard trims spaces more appropriately (#8550).
  • The clipboard bindings ignore X-based clipboard programs if the DISPLAY environment variable is not set, which helps prefer the Windows clipboard when it is available (such as on WSL).
  • funcsave will remove a saved copy of a function that has been erased with functions --erase.
  • The Web-based configuration tool gained a number of improvements, including the ability to set pager colors.
  • The default fish_title prints a shorter title with shortened $PWD and no more redundant “fish” (#8641).
  • Holding down an arrow key won’t freeze the terminal with long periods of flashing (#8610).
  • Multi-char bindings are no longer interrupted if a signal handler enqueues an event. (#8628).

New or improved bindings

  • Escape can now bound without breaking arrow key bindings (#8428).
  • The Alt-H binding (to open a command’s manual page) now also ignores command (#8447).

Improved prompts

  • The fish_status_to_signal helper function returns the correct signal names for the current platform, rather than Linux (#8530).
  • The prompt_pwd helper function learned a --full-length-dirs N option to keep the last N directory components unshortened. In addition the number of characters to shorten each component should be shortened to can now be given as -d N or --dir-length N. (#8208):
> prompt_pwd --full-length-dirs 2 -d 1 ~/dev/fish-shell/share/tools/web_config
~/d/f/s/tools/web_config

Completions

  • Added completions for:
  • Improvements to many completions, especially for git aliases (#8129), subcommands (#8134) and submodules (#8716).
  • Many adjustments to complete correct options for system utilities on BSD and macOS.
  • When evaluating custom completions, the command line state no longer includes variable overrides (var=val). This unbreaks completions that read commandline -op.

Improved terminal support

  • Dynamic terminal titles are enabled on WezTerm (#8121).
  • Directory history navigation works out of the box with Apple Terminal’s default key settings (#2330).
  • fish now assumes Unicode 9+ widths for emoji under iTerm 2 (#8200).
  • Skin-tone emoji modifiers (U+1F3FB through U+1F3FF) are now measured as width 0 (#8275).
  • fish’s escape sequence removal now also knows Tmux’s wrapped escapes.
  • Vi mode cursors are enabled in Apple Terminal.app (#8167).
  • Vi cursor shaping and $PWD reporting is now also enabled on foot (#8422).
  • ls will use colors also on newer versions of Apple Terminal.app (#8309).
  • The Delete and Shift-Tab keys work more reliably under st (#8352, #8354).

Other improvements

  • Fish’s test suite now uses ctest, and has become much faster to run. It is now also possible to run only specific tests with targets named test_$filename - make test_set.fish only runs the set.fish test. (#7851)
  • The HTML version of the documentation now includes copy buttons for code examples (#8218).
  • The HTML version of the documentation and the web-based configuration tool now pick more modern system fonts instead of falling back to Arial and something like Courier New most of the time (#8632).
  • The Debian & Ubuntu package linked from fishshell.com is now a single package, rather than split into fish and fish-common (#7845).
  • The macOS installer does not assert that Rosetta is required to install fish on machines with Apple Silicon (#8566).
  • The macOS installer now cleans up previous .pkg installations when upgrading. (#2963).

For distributors

  • The minimum version of CMake required to build fish is now 3.5.0.
  • The CMake installation supports absolute paths for CMAKE_INSTALL_DATADIR (#8150).
  • Building using NetBSD curses works on any platform (#8087).
  • The build system now uses the default linker instead of forcing use of the gold or lld linker (#8152).

Download links: To download the source code for fish, use the file named "fish-3.4.0.tar.xz". The file downloaded from "Source code (tar.gz)" has extra build requirements. The SHA-256 sum of this file is b5b48ab8486b19ef716a32f7f46b88b9ea5356155f0e967ee99f4093645413c5. A GPG signature from David Adam (key ID 0x7A67D962D88A709A) is available as "fish-3.4.0.tar.xz.asc".

3.3.1

2 years ago

This release of fish fixes the following problems identified in fish 3.3.0:

  • The prompt and command line are redrawn correctly in response to universal variable changes (#8088).
  • A superfluous error that was produced when setting the PATH or CDPATH environment variables to include colon-delimited components that do not exist was removed (#8095).
  • The Vi mode indicator in the prompt is repainted correctly after Ctrl-C cancels the current command (#8103).
  • fish builds correctly on platforms that do not have a spawn.h header, such as old versions of OS X (#8097).

A number of improvements to the documentation, and fixes for completions, are included as well.

If you are upgrading from version 3.2.2 or before, please also review the release notes for 3.3.0.


Download links: To download the source code for fish, use the file named "fish-3.3.1.tar.xz". The file downloaded from "Source code (tar.gz)" has extra build requirements. The SHA-256 sum of this file is b5b4ee1a5269762cbbe993a4bd6507e675e4100ce9bbe84214a5eeb2b19fae89. A GPG signature from David Adam (key ID 0x7A67D962D88A709A) is available as "fish-3.3.1.tar.xz.asc".

3.3.0

2 years ago

Notable improvements and fixes

  • fish_config gained a prompt subcommand to show and pick from the sample prompts directly in the terminal, instead of having to open a webbrowser. For example fish_config prompt choose default loads the default prompt in the current session (#7958).
  • The documentation has been reorganized to be easier to understand (#7773).

Deprecations and removed features

  • The $fish_history value "default" is no longer special. It used to be treated the same as "fish" (#7650).
  • Redirection to standard error with the ^ character has been disabled by default. It can be turned back on using the stderr-nocaret feature flag, but will eventually be disabled completely (#7105).
  • Specifying an initial tab to fish_config now only works with fish_config browse (e.g. fish_config browse variables), otherwise it would interfere with the new prompt subcommand (see below) (#7958).

Scripting improvements

  • math gained new functions log2 (like the documentation claimed), max and min (#7856). math functions can be used without the parentheses (eg math sin 2 + 6), and functions have the lowest precedence in the order of operations (#7877).
  • Shebang (#!) lines are no longer required within shell scripts, improving support for scripts with concatenated binary contents. If a file fails to execute and passes a (rudimentary) binary safety check, fish will re-invoke it using /bin/sh (#7802).
  • Exit codes are better aligned with bash. A failed execution now reports $status of 127 if the file is not found, and 126 if it is not executable.
  • echo no longer writes its output one byte at a time, improving performance and allowing use with Linux's special API files (/proc, /sys and such) (#7836).
  • fish should now better handle cd on filesystems with broken stat(3) responses (#7577).
  • Builtins now properly report a $status of 1 upon unsuccessful writes (#7857).
  • string match with unmatched capture groups and without the --all flag now sets an empty variable instead of a variable containing the empty string. It also correctly imports the first match if multiple arguments are provided, matching the documentation. (#7938).
  • fish produces more specific errors when a command in a command substitution wasn't found or is not allowed. This now prints something like "Unknown command" instead of "Unknown error while evaluating command substitution".
  • fish_indent allows inline variable assignments (FOO=BAR command) to use line continuation, instead of joining them into one line (#7955).
  • fish gained a --no-config option to disable configuration files. This applies to user-specific and the systemwide config.fish (typically in /etc/fish/config.fish), and configuration snippets (typically in conf.d directories). It also disables universal variables, history, and loading of functions from system or user configuration directories (#7921, #1256).
  • When universal variables are unavailable for some reason, setting a universal variable now sets a global variable instead (#7921).
  • $last_pid now contains the process ID of the last process in the pipeline, allowing it to be used in scripts (#5036, #5832, #7721). Previously, this value contained the process group ID, but in scripts this was the same as the running fish's process ID.
  • process-exit event handlers now receive the same value as $status in all cases, instead of receiving -1 when the exit was due to a signal.
  • process-exit event handlers for PID 0 also received JOB_EXIT events; this has been fixed.
  • job-exit event handlers may now be created with any of the PIDs from the job. The handler is passed the last PID in the job as its second argument, instead of the process group.
  • Trying to set an empty variable name with set no longer works (these variables could not be used in expansions anyway).
  • fish_add_path handles an undefined PATH environment variable correctly (#8082).

Interactive improvements

  • Commands entered before the previous command finishes will now be properly syntax highlighted.
  • fish now automatically creates config.fish and the configuration directories in $XDG_CONFIG_HOME/fish (by default ~/.config/fish) if they do not already exist (#7402).
  • $SHLVL is no longer incremented in non-interactive shells. This means it won't be set to values larger than 1 just because your environment happens to run some scripts in $SHELL in its startup path (#7864).
  • fish no longer rings the bell when flashing the command line. The flashing should already be enough notification and the bell can be annoying (#7875).
  • fish --help is more helpful if the documentation isn't installed (#7824).
  • funced won't include an entry on where a function is defined, thanks to the new functions --no-details option (#7879).
  • A new variable, fish_killring, containing entries from the killring, is now available (#7445).
  • fish --private prints a note on private mode on startup even if $fish_greeting is an empty list (#7974).
  • fish no longer attempts to lock history or universal variable files on remote filesystems, including NFS and Samba mounts. In rare cases, updates to these files may be dropped if separate fish instances modify them simultaneously. (#7968).
  • wait and on-process-exit work correctly with jobs that have already exited (#7210).
  • __fish_print_help (used for --help output for fish's builtins) now respects the LESS environment variable, and if not set, uses better default pager settings (#7997).
  • Errors from alias are now printed to standard error, matching other builtins and functions (#7925).
  • ls output is colorized on OpenBSD if colorls utility is installed (#8035)
  • The default pager color looks better in terminals with light backgrounds (#3412).
  • Further robustness improvements to the bash history import (#7874).
  • fish now tries to find a Unicode-aware locale for encoding (LC_CTYPE) if started without any locale information, improving the display of emoji and other non-ASCII text on misconfigured systems (#8031). To allow a C locale, set the variable fish_allow_singlebyte_locale to 1.
  • The Web-based configuration and documentation now feature a dark mode if the browser requests it (#8043).
  • Color variables can now also be given like --background red and -b red, not just --background=red (#8053).
  • exit run within fish_prompt now exits properly (#8033).
  • When attempting to execute the unsupported POSIX-style brace command group ({ ... }) fish will suggest its equivalent begin; ...; end commands (#6415).

New or improved bindings

  • Pasting in Vi mode puts text in the right place in normal mode (#7847).
  • Vi mode's u is bound to undo instead of history-search-backward, following GNU readline's behavior. Similarly, Control-R is bound to redo instead of history-search-backward, following Vim (#7908).
  • s in Vi visual mode now does the same thing as c (#8039).
  • The binding for "\*y now uses fish_clipboard_copy, allowing it to support more than just xsel.
  • The Control-Space binding can be correctly customised (#7922).
  • exit works correctly in bindings (#7967).
  • The F1 binding, which opens the manual page for the current command, now works around a bug in certain less versions that fail to clear the screen (#7863).
  • The binding for Alt-S now toggles whether sudo is prepended, even when it took the commandline from history instead of only adding it.
  • The new functions fish_commandline_prepend and fish_commandline_append allow toggling the presence of a prefix/suffix on the current commandline. (#7905).
  • backward-kill-path-component Control-W) no longer erases parts of two tokens when the cursor is positioned immediately after /. (#6258).

Improved prompts

  • The default Vi mode prompt now uses foreground instead of background colors, making it less obtrusive (#7880).
  • Performance of the "informative" git prompt is improved somewhat (#7871). This is still slower than the non-informative version by its very nature. In particular it is IO-bound, so it will be very slow on slow disks or network mounts.
  • The sample prompts were updated. Some duplicated prompts, like the various classic variants, or less useful ones, like the "justadollar" prompt were removed, some prompts were cleaned up, and in some cases renamed. A new "simple" and "disco" prompt were added (#7884, #7897, #7930). The new prompts will only take effect when selected and existing installed prompts will remain unchanged.
  • A new prompt_login helper function to describe the kind of "login" (user, host and chroot status) for use in prompts. This replaces the old "debian chroot" prompt and has been added to the default and terlar prompts (#7932).
  • The Web-based configuration's prompt picker now shows and installs right prompts (#7930).
  • The git prompt now has the same symbol order in normal and "informative" mode, and it's customizable via $__fish_git_prompt_status_order (#7926).

Completions

  • Added completions for:
  • Improvements to plenty of completions!
  • Commands that wrap cd (using complete --wraps cd) get the same completions as cd (#4693).
  • The --force-files option to complete works for bare arguments, not just options (#7920).
  • Completion descriptions for functions don't include the function definition, making them more concise (#7911).
  • The kill completions no longer error on MSYS2 (#8046).
  • Completion scripts are now loaded when calling a command via a relative path (like ./git) (#6001, #7992).
  • When there are multiple completion candidates, fish inserts their shared prefix. This prefix was computed in a case-insensitive way, resulting in wrong case in the completion pager. This was fixed by only inserting prefixes with matching case (#7744).

Improved terminal support

  • fish no longer tries to detect a missing new line during startup, preventing an erroneous from appearing if the terminal is resized at the wrong time, which can happen in tiling window managers (#7893).
  • fish behaves better when it disagrees with the terminal on the width of characters. In particular, staircase effects with right prompts should be gone in most cases (#8011).
  • If the prompt takes up the entire line, the last character should no longer be chopped off in certain terminals (#8002).
  • fish's reflow handling has been disabled by default for kitty (#7961).
  • The default prompt no longer produces errors when used with a dumb terminal (#7904).
  • Terminal size variables are updated for window size change signal handlers (SIGWINCH).
  • Pasting within a multi-line command using a terminal that supports bracketed paste works correctly, instead of producing an error (#7782).
  • set_color produces an error when used with invalid arguments, rather than empty output which interacts badly with Cartesian product expansion.

For distributors

  • fish runs correctly on platforms without the O_CLOEXEC flag for open(2) (#8023).

Download links: To download the source code for fish, use the file named "fish-3.3.0.tar.xz". The file downloaded from "Source code (tar.gz)" has extra build requirements. The SHA-256 sum of this file is a4215e4cab2a5b101b0b8843720bda3c7eb98e8a14dca0950b8ef17e94282faa. A GPG signature from David Adam (key ID 0x7A67D962D88A709A) is available as "fish-3.3.0.tar.xz.asc".

3.2.2

3 years ago

This release of fish fixes a number of additional issues identified in the fish 3.2 series:

  • The command-not-found handler used suggestions from pacman on Arch Linux, but this caused major slowdowns on some systems and has been disabled (#7841).
  • fish will no longer hang on exit if another process is in the foreground on macOS (#7901).
  • Certain programs (such as lazygit) could create situations where fish would not receive keystrokes correctly, but it is now more robust in these situations (#7853).
  • Arguments longer than 1024 characters no longer trigger excessive CPU usage on macOS (#7837).
  • fish builds correctly on macOS when using new versions of Xcode (#7838).
  • Completions for aura (#7865) and tshark (#7858) should no longer produce errors.
  • Background jobs no longer interfere with syntax highlighting (a regression introduced in fish 3.2.1, #7842).

If you are upgrading from version 3.1.2 or before, please also review the release notes for 3.2.1 and 3.2.0.


Download links: To download the source code for fish, use the file named "fish-3.2.2.tar.xz". The file downloaded from "Source code (tar.gz)" will not build correctly. The SHA-256 sum of this file is 5944da1a8893d11b0828a4fd9136ee174549daffb3d0adfdd8917856fe6b4009. A GPG signature from David Adam (key ID 0x7A67D962D88A709A) is available as "fish-3.2.2.tar.xz.asc".

3.2.1

3 years ago

This release of fish fixes the following problems identified in fish 3.2.0:

  • Commands in key bindings are run with fish's internal terminal modes, instead of the terminal modes typically used for commands. This fixes a bug introduced in 3.2.0, where text would unexpectedly appear on the terminal, especially when pasting (#7770).
  • Prompts which use the internal __fish_print_pipestatus function will display correctly rather than carrying certain modifiers (such as bold) further than intended (#7771).
  • Redirections to internal file descriptors is allowed again, reversing the changes in 3.2.0. This fixes a problem with Midnight Commander (#7769).
  • Universal variables should be fully reliable regardless of operating system again (#7774).
  • fish_git_prompt no longer causes screen flickering in certain terminals (#7775).
  • fish_add_path manipulates the fish_user_paths variable correctly when moving multiple paths (#7776).
  • Pasting with a multi-line command no longer causes a __fish_tokenizer_state error (#7782).
  • psub inside event handlers cleans up temporary files properly (#7792).
  • Event handlers declared with --on-job-exit $fish_pid no longer run constantly (#7721), although these functions should use --on-event fish_exit instead.
  • Changing terminal modes inside config.fish works (#7783).
  • set_color --print-colors no longer prints all colors in bold (#7805)
  • Completing commands starting with a - no longer prints an error (#7809).
  • Running fish_command_not_found directly no longer produces an error on macOS or other OSes which do not have a handler available (#7777).
  • The new type builtin now has the (deprecated) --quiet long form of -q (#7766).

It also includes some small enhancements:

  • help and fish_config work correctly when fish is running in a Chrome OS Crostini Linux VM (#7789).
  • The history file can be made a symbolic link without it being overwritten (#7754), matching a similar improvement for the universal variable file in 3.2.0.
  • An unhelpful error ("access: No error"), seen on Cygwin, is no longer produced (#7785).
  • Improvements to the rsync completions (#7763), some completion descriptions (#7788), and completions that use IP address (#7787).
  • Improvements to the appearance of fish_config (#7811).

If you are upgrading from version 3.1.2 or before, please also review the release notes for 3.2.0 (included below).


Download links: To download the source code for fish, use the file named "fish-3.2.1.tar.xz". The file downloaded from "Source code (tar.gz)" will not build correctly. The SHA-256 sum of this file is d8e49f4090d3778df17dd825e4a2a80192015682423cd9dd02b6675d65c3af5b. A GPG signature from David Adam (key ID 0x7A67D962D88A709A) is available as "fish-3.2.1.tar.xz.asc".

3.2.0

3 years ago

3.1.2

4 years ago

Download links: To download the source code for fish, use the file named "fish-3.1.2.tar.gz". The SHA-256 sum of this file is d5b927203b5ca95da16f514969e2a91a537b2f75bec9b21a584c4cd1c7aa74ed. The file downloaded from "Source code (tar.gz)" will not build correctly. A GPG signature from David Adam (0x7A67D962D88A709A) is available as "fish-3.1.2.tar.gz.asc".

This release of fish fixes a major issue discovered in fish 3.1.1:

  • Commands such as fzf and enhancd, when used with eval, would hang. eval buffered output too aggressively, which has been fixed (#6955).

If you are upgrading from version 3.0.0 or before, please also review the release notes for 3.1.1, 3.1.0 and 3.1b1.

3.1.1

4 years ago

Download links: To download the source code for fish, use the file named "fish-3.1.1.tar.gz". The SHA-256 sum of this file is 07dc78eea3bc4cbd490b2f2a2e19e5771ac9e3b6b1a75893039ad8b34d6122b8. The file downloaded from "Source code (tar.gz)" will not build correctly. A GPG signature from David Adam (0x7A67D962D88A709A) is available as "fish-3.1.1.tar.gz.asc".

This release of fish fixes a number of major issues discovered in fish 3.1.0.

  • Commands which involve . ( ... | psub) now work correctly, as a bug in the function --on-job-exit option has been fixed (#6613).
  • Conflicts between upstream packages for ripgrep and bat, and the fish packages, have been resolved (#5822).
  • Starting fish in a directory without read access, such as via su, no longer crashes (#6597).
  • Glob ordering changes which were introduced in 3.1.0 have been reverted, returning the order of globs to the previous state (#6593).
  • Redirections using the deprecated caret syntax to a file descriptor (eg ^&2) work correctly (#6591).
  • Redirections that append to a file descriptor (eg 2>>&1) work correctly (#6614).
  • Building fish on macOS (#6602) or with new versions of GCC (#6604, #6609) is now successful.
  • time is now correctly listed in the output of builtin -n, and time --help works correctly (#6598).
  • Exported universal variables now update properly (#6612).
  • status current-command gives the expected output when used with an environment override - that is, F=B status current-command returns status instead of F=B (#6635).
  • test no longer crashes when used with "nan" or "inf" arguments, erroring out instead (#6655).
  • Copying from the end of the command line no longer crashes fish (#6680).
  • read no longer removes multiple separators when splitting a variable into a list, restoring the previous behaviour from fish 3.0 and before (#6650).
  • Functions using --on-job-exit and --on-process-exit work reliably again (#6679).
  • Functions using --on-signal INT work reliably in interactive sessions, as they did in fish 2.7 and before (#6649). These handlers have never worked in non-interactive sessions, and making them work is an ongoing process.
  • Functions using --on-variable work reliably with variables which are set implicitly (rather than with set), such as "fish_bind_mode" and "PWD" (#6653).
  • 256 colors are properly enabled under certain conditions that were incorrectly detected in fish 3.1.0 ($TERM begins with xterm, does not include "256color", and $TERM_PROGRAM is not set) (#6701).
  • The Mercurial (hg) prompt no longer produces an error when the current working directory is removed (#6699). Also, for performance reasons it shows only basic information by default; to restore the detailed status, set $fish_prompt_hg_show_informative_status.
  • The VCS prompt, fish_vcs_prompt, no longer displays Subversion (svn) status by default, due to the potential slowness of this operation (#6681).
  • Pasting of commands has been sped up (#6713).
  • Using extended Unicode characters, such as emoji, in a non-Unicode capable locale (such as the C or POSIX locale) no longer renders all output blank (#6736).
  • help prefers to use xdg-open, avoiding the use of open on Debian systems where this command is actually openvt (#6739).
  • Command lines starting with a space, which are not saved in history, now do not get autosuggestions. This fixes an issue with Midnight Commander integration (#6763), but may be changed in a future version.
  • Copying to the clipboard no longer inserts a newline at the end of the content, matching fish 2.7 and earlier (#6927).
  • fzf in complex pipes no longer hangs. More generally, code run as part of command substitutions or eval will no longer have separate process groups. (#6624, #6806).

This release also includes:

  • a number of changes to improve macOS compatibility with code signing and notarization;
  • a number of improvements to completions; and
  • a number of content and formatting improvements to the documentation.

If you are upgrading from version 3.0.0 or before, please also review the release notes for 3.1.0 and 3.1b1.

Errata for fish 3.1

A new builtin, time, was introduced in the fish 3.1 releases. This builtin is a reserved word (like test, function, and others) because of the way it is implemented, and functions can no longer be named time. This was not clear in the fish 3.1b1 release notes.

3.1.0

4 years ago

Download links: To download the source code for fish, use the file named "fish-3.1.0.tar.gz". The SHA-256 sum of this file is e5db1e6839685c56f172e1000c138e290add4aa521f187df4cd79d4eab294368. The file downloaded from "Source code (tar.gz)" will not build correctly. A GPG signature from David Adam (0x7A67D962D88A709A) is available as "fish-3.1.0.tar.gz.asc".

Compared to the beta release of fish 3.1b1, fish version 3.1.0:

  • fixes a regression where spaces after a brace were removed despite brace expansion not occurring (#6564)
  • fixes a number of problems in compiling and testing on Cygwin (#6549) and Solaris-derived systems such as Illumos (#6553, #6554, #6555, #6556, and #6558);
  • fixes the process for building macOS packages; and
  • contains some improvements to the documentation and a small number of completions.

If you are upgrading from version 3.0.0 or before, please also review the release notes for 3.1b1 (included below).


fish 3.1b1 (released January 26, 2020)

Notable improvements and fixes

  • A new $pipestatus variable contains a list of exit statuses of the previous job, for each of the separate commands in a pipeline (#5632).
  • fish no longer buffers pipes to the last function in a pipeline, improving many cases where pipes appeared to block or hang (#1396).
  • An overhaul of error messages for builtin commands, including a removal of the overwhelming usage summary, more readable stack traces (#3404, #5434), and stack traces for test (aka [) (#5771).
  • fish's debugging arguments have been significantly improved. The --debug-level option has been removed, and a new --debug option replaces it. This option accepts various categories, which may be listed via fish --print-debug-categories (#5879). A new --debug-output option allows for redirection of debug output.
  • string has a new collect subcommand for use in command substitutions, producing a single output instead of splitting on new lines (similar to "$(cmd)" in other shells) (#159).
  • The fish manual, tutorial and FAQ are now available in man format as fish-doc, fish-tutorial and fish-faq respectively (#5521).
  • Like other shells, cd now always looks for its argument in the current directory as a last resort, even if the CDPATH variable does not include it or "." (#4484).
  • fish now correctly handles CDPATH entries that start with .. (#6220) or contain ./ (#5887).
  • The fish_trace variable may be set to trace execution (#3427). This performs a similar role as set -x in other shells.
  • fish uses the temporary directory determined by the system, rather than relying on /tmp (#3845).
  • The fish Web configuration tool (fish_config) prints a list of commands it is executing, to help understanding and debugging (#5584).
  • Major performance improvements when pasting (#5866), executing lots of commands (#5905), importing history from bash (#6295), and when completing variables that might match $history (#6288).

Syntax changes and new commands

  • A new builtin command, time, which allows timing of fish functions and builtins as well as external commands (#117).
  • Brace expansion now only takes place if the braces include a "," or a variable expansion, meaning common commands such as git reset HEAD@{0} do not require escaping (#5869).
  • New redirections &> and &| may be used to redirect or pipe stdout, and also redirect stderr to stdout (#6192).
  • switch now allows arguments that expand to nothing, like empty variables (#5677).
  • The VAR=val cmd syntax can now be used to run a command in a modified environment (#6287).
  • and is no longer recognised as a command, so that nonsensical constructs like and and and produce a syntax error (#6089).
  • math's exponent operator, '^', was previously left-associative, but now uses the more commonly-used right-associative behaviour (#6280). This means that math '3^0.5^2' was previously calculated as '(3^0.5)^2', but is now calculated as '3^(0.5^2)'.
  • In fish 3.0, the variable used with for loops inside command substitutions could leak into enclosing scopes; this was an inadvertent behaviour change and has been reverted (#6480).

Scripting improvements

  • string split0 now returns 0 if it split something (#5701).
  • In the interest of consistency, builtin -q and command -q can now be used to query if a builtin or command exists (#5631).
  • math now accepts --scale=max for the maximum scale (#5579).
  • builtin $var now works correctly, allowing a variable as the builtin name (#5639).
  • cd understands the -- argument to make it possible to change to directories starting with a hyphen (#6071).
  • complete --do-complete now also does fuzzy matches (#5467).
  • complete --do-complete can be used inside completions, allowing limited recursion (#3474).
  • count now also counts lines fed on standard input (#5744).
  • eval produces an exit status of 0 when given no arguments, like other shells (#5692).
  • printf prints what it can when input hasn't been fully converted to a number, but still prints an error (#5532).
  • complete -C foo now works as expected, rather than requiring complete -Cfoo.
  • complete has a new --force-files option, to re-enable file completions. This allows sudo -E and pacman -Qo to complete correctly (#5646).
  • argparse now defaults to showing the current function name (instead of argparse) in its errors, making --name often superfluous (#5835).
  • argparse has a new --ignore-unknown option to keep unrecognized options, allowing multiple argparse passes to parse options (#5367).
  • argparse correctly handles flag value validation of options that only have short names (#5864).
  • read -S (short option of --shell) is recognised correctly (#5660).
  • read understands --list, which acts like --array in reading all arguments into a list inside a single variable, but is better named (#5846).
  • read has a new option, --tokenize, which splits a string into variables according to the shell's tokenization rules, considering quoting, escaping, and so on (#3823).
  • read interacts more correctly with the deprecated $IFS variable, in particular removing multiple separators when splitting a variable into a list (#6406), matching other shells.
  • fish_indent now handles semicolons better, including leaving them in place for ; and and ; or instead of breaking the line (#5859).
  • fish_indent --write now supports multiple file arguments, indenting them in turn.
  • The default read limit has been increased to 100MiB (#5267).
  • math now also understands x for multiplication, provided it is followed by whitespace (#5906).
  • math reports the right error when incorrect syntax is used inside parentheses (#6063), and warns when unsupported logical operations are used (#6096).
  • functions --erase now also prevents fish from autoloading a function for the first time (#5951).
  • jobs --last returns 0 to indicate success when a job is found (#6104).
  • commandline -p and commandline -j now split on && and || in addition to ; and & (#6214).
  • A bug where string split would drop empty strings if the output was only empty strings has been fixed (#5987).
  • eval no long creates a new local variable scope, but affects variables in the scope it is called from (#4443). source still creates a new local scope.
  • abbr has a new --query option to check for the existence of an abbreviation.
  • Local values for fish_complete_path and fish_function_path are now ignored; only their global values are respected.
  • Syntax error reports now display a marker in the correct position (#5812).
  • Empty universal variables may now be exported (#5992).
  • Exported universal variables are no longer imported into the global scope, preventing shadowing. This makes it easier to change such variables for all fish sessions and avoids breakage when the value is a list of multiple elements (#5258).
  • A bug where for could use invalid variable names has been fixed (#5800).
  • A bug where local variables would not be exported to functions has been fixed (#6153).
  • The null command (:) now always exits successfully, rather than passing through the previous exit status (#6022).
  • The output of functions FUNCTION matches the declaration of the function, correctly including comments or blank lines (#5285), and correctly includes any --wraps flags (#1625).
  • type supports a new option, --short, which suppress function expansion (#6403).
  • type --path with a function argument will now output the path to the file containing the definition of that function, if it exists.
  • type --force-path with an argument that cannot be found now correctly outputs nothing, as documented (#6411).
  • The $hostname variable is no longer truncated to 32 characters (#5758).
  • Line numbers in function backtraces are calculated correctly (#6350).
  • A new fish_cancel event is emitted when the command line is cancelled, which is useful for terminal integration (#5973).

Interactive improvements

  • New Base16 color options are available through the Web-based configuration (#6504).
  • fish only parses /etc/paths on macOS in login shells, matching the bash implementation (#5637) and avoiding changes to path ordering in child shells (#5456). It now ignores blank lines like the bash implementation (#5809).
  • The locale is now reloaded when the LOCPATH variable is changed (#5815).
  • read no longer keeps a history, making it suitable for operations that shouldn't end up there, like password entry (#5904).
  • dirh outputs its stack in the correct order (#5477), and behaves as documented when universal variables are used for its stack (#5797).
  • funced and the edit-commandline-in-buffer bindings did not work in fish 3.0 when the $EDITOR variable contained spaces; this has been corrected (#5625).
  • Builtins now pipe their help output to a pager automatically (#6227).
  • set_color now colors the --print-colors output in the matching colors if it is going to a terminal.
  • fish now underlines every valid entered path instead of just the last one (#5872).
  • When syntax highlighting a string with an unclosed quote, only the quote itself will be shown as an error, instead of the whole argument.
  • Syntax highlighting works correctly with variables as commands (#5658) and redirections to close file descriptors (#6092).
  • help works properly on Windows Subsytem for Linux (#5759, #6338).
  • A bug where disown could crash the shell has been fixed (#5720).
  • fish will not autosuggest files ending with ~ unless there are no other candidates, as these are generally backup files (#985).
  • Escape in the pager works correctly (#5818).
  • Key bindings that call fg no longer leave the terminal in a broken state (#2114).
  • Brackets (#5831) and filenames containing $ (#6060) are completed with appropriate escaping.
  • The output of complete and functions is now colorized in interactive terminals.
  • The Web-based configuration handles aliases that include single quotes correctly (#6120), and launches correctly under Termux (#6248) and OpenBSD (#6522).
  • function now correctly validates parameters for --argument-names as valid variable names (#6147) and correctly parses options following --argument-names, as in "--argument-names foo --description bar" (#6186).
  • History newly imported from bash includes command lines using && or ||.
  • The automatic generation of completions from manual pages is better described in job and process listings, and no longer produces a warning when exiting fish (#6269).
  • In private mode, setting $fish_greeting to an empty string before starting the private session will prevent the warning about history not being saved from being printed (#6299).
  • In the interactive editor, a line break (Enter) inside unclosed brackets will insert a new line, rather than executing the command and producing an error (#6316).
  • Ctrl-C always repaints the prompt (#6394).
  • When run interactively from another program (such as Python), fish will correctly start a new process group, like other shells (#5909).
  • Job identifiers (for example, for background jobs) are assigned more logically (#6053).
  • A bug where history would appear truncated if an empty command was executed was fixed (#6032).

New or improved bindings

  • Pasting strips leading spaces to avoid pasted commands being omitted from the history (#4327).
  • Shift-Left and Shift-Right now default to moving backwards and forwards by one bigword (words separated by whitespace) (#1505).
  • The default escape delay (to differentiate between the escape key and an alt-combination) has been reduced to 30ms, down from 300ms for the default mode and 100ms for Vi mode (#3904).
  • The forward-bigword binding now interacts correctly with autosuggestions (#5336).
  • The fish_clipboard_* functions support Wayland by using wl-clipboard (#5450).
  • The nextd and prevd functions no longer print "Hit end of history", instead using a bell. They correctly store working directories containing symbolic links (#6395).
  • If a fish_mode_prompt function exists, Vi mode will only execute it on mode-switch instead of the entire prompt. This should make it much more responsive with slow prompts (#5783).
  • The path-component bindings (like Ctrl-w) now also stop at ":" and "@", because those are used to denote user and host in commands such as ssh (#5841).
  • The NULL character can now be bound via bind -k nul. Terminals often generate this character via control-space. (#3189).
  • A new readline command expand-abbr can be used to trigger abbreviation expansion (#5762).
  • A new readline command, delete-or-exit, removes a character to the right of the cursor or exits the shell if the command line is empty (moving this functionality out of the delete-or-exit function).
  • The self-insert readline command will now insert the binding sequence, if not empty.
  • A new binding to prepend sudo, bound to Alt-S by default (#6140).
  • The Alt-W binding to describe a command should now work better with multiline prompts (#6110)
  • The Alt-H binding to open a command's man page now tries to ignore sudo (#6122).
  • A new pair of bind functions, history-prefix-search-backward (and forward), was introduced (#6143).
  • Vi mode now supports R to enter replace mode (#6342), and d0 to delete the current line (#6292).
  • In Vi mode, hitting Enter in replace-one mode no longer erases the prompt (#6298).
  • Selections in Vi mode are inclusive, matching the actual behaviour of Vi (#5770).

Improved prompts

  • The Git prompt in informative mode now shows the number of stashes if enabled.
  • The Git prompt now has an option ($__fish_git_prompt_use_informative_chars) to use the (more modern) informative characters without enabling informative mode.
  • The default prompt now also features VCS integration and will color the host if running via SSH (#6375).
  • The default and example prompts print the pipe status if an earlier command in the pipe fails.
  • The default and example prompts try to resolve exit statuses to signal names when appropriate.

Improved terminal output

  • New fish_pager_color_ options have been added to control more elements of the pager's colors (#5524).
  • Better detection and support for using fish from various system consoles, where limited colors and special characters are supported (#5552).
  • fish now tries to guess if the system supports Unicode 9 (and displays emoji as wide), eliminating the need to set $fish_emoji_width in most cases (#5722).
  • Improvements to the display of wide characters, particularly Korean characters and emoji (#5583, #5729).
  • The Vi mode cursor is correctly redrawn when regaining focus under terminals that report focus (eg tmux) (#4788).
  • Variables that control background colors (such as fish_pager_color_search_match) can now use --reverse.

Completions

  • Added completions for
    • aws
    • bat (#6052)
    • bosh (#5700)
    • btrfs
    • camcontrol
    • cf (#5700)
    • chronyc (#6496)
    • code (#6205)
    • cryptsetup (#6488)
    • csc and csi (#6016)
    • cwebp (#6034)
    • cygpath and cygstart (#6239)
    • epkginfo (#5829)
    • ffmpeg, ffplay, and ffprobe (#5922)
    • fsharpc and fsharpi (#6016)
    • fzf (#6178)
    • g++ (#6217)
    • gpg1 (#6139)
    • gpg2 (#6062)
    • grub-mkrescue (#6182)
    • hledger (#6043)
    • hwinfo (#6496)
    • irb (#6260)
    • iw (#6232)
    • kak
    • keepassxc-cli (#6505)
    • keybase (#6410)
    • loginctl (#6501)
    • lz4, lz4c and lz4cat (#6364)
    • mariner (#5718)
    • nethack (#6240)
    • patool (#6083)
    • phpunit (#6197)
    • plutil (#6301)
    • pzstd (#6364)
    • qubes-gpg-client (#6067)
    • resolvectl (#6501)
    • rg
    • rustup
    • sfdx (#6149)
    • speedtest and speedtest-cli (#5840)
    • src (#6026)
    • tokei (#6085)
    • tsc (#6016)
    • unlz4 (#6364)
    • unzstd (#6364)
    • vbc (#6016)
    • zpaq (#6245)
    • zstd, zstdcat, zstdgrep, zstdless and zstdmt (#6364)
  • Lots of improvements to completions.
  • Selecting short options which also have a long name from the completion pager is possible (#5634).
  • Tab completion will no longer add trailing spaces if they already exist (#6107).
  • Completion of subcommands to builtins like and or not now works correctly (#6249).
  • Completion of arguments to short options works correctly when multiple short options are used together (#332).
  • Activating completion in the middle of an invalid completion does not move the cursor any more, making it easier to fix a mistake (#4124).
  • Completion in empty commandlines now lists all available commands.
  • Functions listed as completions could previously leak parts of the function as other completions; this has been fixed.

Deprecations and removed features

  • The vcs-prompt functions have been promoted to names without double-underscore, so __fish_git_prompt is now fish_git_prompt, __fish_vcs_prompt is now fish_vcs_prompt, __fish_hg_prompt is now fish_hg_prompt and __fish_svn_prompt is now fish_svn_prompt. Shims at the old names have been added, and the variables have kept their old names (#5586).
  • string replace has an additional round of escaping in the replacement expression, so escaping backslashes requires many escapes (eg string replace -ra '([ab])' '\\\\\\\$1' a). The new feature flag regex-easyesc can be used to disable this, so that the same effect can be achieved with string replace -ra '([ab])' '\\\\$1' a (#5556). As a reminder, the intention behind feature flags is that this will eventually become the default and then only option, so scripts should be updated.
  • The fish_vi_mode function, deprecated in fish 2.3, has been removed. Use fish_vi_key_bindings instead (#6372).

For distributors and developers

  • fish 3.0 introduced a CMake-based build system. In fish 3.1, both the Autotools-based build and legacy Xcode build system have been removed, leaving only the CMake build system. All distributors and developers must install CMake.
  • fish now depends on the common tee external command, for the psub process substitution function.
  • The documentation is now built with Sphinx. The old Doxygen-based documentation system has been removed. Developers, and distributors who wish to rebuild the documentation, must install Sphinx.
  • The INTERNAL_WCWIDTH build option has been removed, as fish now always uses an internal wcwidth function. It has a number of configuration options that make it more suitable for general use (#5777).
  • mandoc can now be used to format the output from --help if nroff is not installed, reducing the number of external dependencies on systems with mandoc installed (#5489).
  • Some bugs preventing building on Solaris-derived systems such as Illumos were fixed (#5458, #5461, #5611).
  • Completions for npm, bower and yarn no longer require the jq utility for full functionality, but will use Python instead if it is available.
  • The paths for completions, functions and configuration snippets have been extended. On systems that define XDG_DATA_DIRS, each of the directories in this variable are searched in the subdirectories fish/vendor_completions.d, fish/vendor_functions.d, and fish/vendor_conf.d respectively. On systems that do not define this variable in the environment, the vendor directories are searched for in both the installation prefix and the default "extra" directory, which now defaults to /usr/local (#5029).

3.1b1

4 years ago

Download links: To download the source code for fish, we suggest the file named "fish-3.1b1.tar.gz". The file downloaded from "Source code (tar.gz)" will not build correctly. The SHA-256 sum of this file is 7847cb2777cc6ea2a18f147a0e567de5bdac4febf6afdfcf867eb45501183a1a. A GPG signature from David Adam (0x7A67D962D88A709A) is available as "fish-3.1b1.tar.gz.asc".

Notable improvements and fixes

  • A new $pipestatus variable contains a list of exit statuses of the previous job, for each of the separate commands in a pipeline (#5632).
  • fish no longer buffers pipes to the last function in a pipeline, improving many cases where pipes appeared to block or hang (#1396).
  • An overhaul of error messages for builtin commands, including a removal of the overwhelming usage summary, more readable stack traces (#3404, #5434), and stack traces for test (aka [) (#5771).
  • fish's debugging arguments have been significantly improved. The --debug-level option has been removed, and a new --debug option replaces it. This option accepts various categories, which may be listed via fish --print-debug-categories (#5879). A new --debug-output option allows for redirection of debug output.
  • string has a new collect subcommand for use in command substitutions, producing a single output instead of splitting on new lines (similar to "$(cmd)" in other shells) (#159).
  • The fish manual, tutorial and FAQ are now available in man format as fish-doc, fish-tutorial and fish-faq respectively (#5521).
  • Like other shells, cd now always looks for its argument in the current directory as a last resort, even if the CDPATH variable does not include it or "." (#4484).
  • fish now correctly handles CDPATH entries that start with .. (#6220) or contain ./ (#5887).
  • The fish_trace variable may be set to trace execution (#3427). This performs a similar role as set -x in other shells.
  • fish uses the temporary directory determined by the system, rather than relying on /tmp (#3845).
  • The fish Web configuration tool (fish_config) prints a list of commands it is executing, to help understanding and debugging (#5584).
  • Major performance improvements when pasting (#5866), executing lots of commands (#5905), importing history from bash (#6295), and when completing variables that might match $history (#6288).

Syntax changes and new commands

  • A new builtin command, time, which allows timing of fish functions and builtins as well as external commands (#117).
  • Brace expansion now only takes place if the braces include a "," or a variable expansion, meaning common commands such as git reset HEAD@{0} do not require escaping (#5869).
  • New redirections &> and &| may be used to redirect or pipe stdout, and also redirect stderr to stdout (#6192).
  • switch now allows arguments that expand to nothing, like empty variables (#5677).
  • The VAR=val cmd syntax can now be used to run a command in a modified environment (#6287).
  • and is no longer recognised as a command, so that nonsensical constructs like and and and produce a syntax error (#6089).
  • math's exponent operator, '^', was previously left-associative, but now uses the more commonly-used right-associative behaviour (#6280). This means that math '3^0.5^2' was previously calculated as '(3^0.5)^2', but is now calculated as '3^(0.5^2)'.
  • In fish 3.0, the variable used with for loops inside command substitutions could leak into enclosing scopes; this was an inadvertent behaviour change and has been reverted (#6480).

Scripting improvements

  • string split0 now returns 0 if it split something (#5701).
  • In the interest of consistency, builtin -q and command -q can now be used to query if a builtin or command exists (#5631).
  • math now accepts --scale=max for the maximum scale (#5579).
  • builtin $var now works correctly, allowing a variable as the builtin name (#5639).
  • cd understands the -- argument to make it possible to change to directories starting with a hyphen (#6071).
  • complete --do-complete now also does fuzzy matches (#5467).
  • complete --do-complete can be used inside completions, allowing limited recursion (#3474).
  • count now also counts lines fed on standard input (#5744).
  • eval produces an exit status of 0 when given no arguments, like other shells (#5692).
  • printf prints what it can when input hasn't been fully converted to a number, but still prints an error (#5532).
  • complete -C foo now works as expected, rather than requiring complete -Cfoo.
  • complete has a new --force-files option, to re-enable file completions. This allows sudo -E and pacman -Qo to complete correctly (#5646).
  • argparse now defaults to showing the current function name (instead of argparse) in its errors, making --name often superfluous (#5835).
  • argparse has a new --ignore-unknown option to keep unrecognized options, allowing multiple argparse passes to parse options (#5367).
  • argparse correctly handles flag value validation of options that only have short names (#5864).
  • read -S (short option of --shell) is recognised correctly (#5660).
  • read understands --list, which acts like --array in reading all arguments into a list inside a single variable, but is better named (#5846).
  • read has a new option, --tokenize, which splits a string into variables according to the shell's tokenization rules, considering quoting, escaping, and so on (#3823).
  • read interacts more correctly with the deprecated $IFS variable, in particular removing multiple separators when splitting a variable into a list (#6406), matching other shells.
  • fish_indent now handles semicolons better, including leaving them in place for ; and and ; or instead of breaking the line (#5859).
  • fish_indent --write now supports multiple file arguments, indenting them in turn.
  • The default read limit has been increased to 100MiB (#5267).
  • math now also understands x for multiplication, provided it is followed by whitespace (#5906).
  • math reports the right error when incorrect syntax is used inside parentheses (#6063), and warns when unsupported logical operations are used (#6096).
  • functions --erase now also prevents fish from autoloading a function for the first time (#5951).
  • jobs --last returns 0 to indicate success when a job is found (#6104).
  • commandline -p and commandline -j now split on && and || in addition to ; and & (#6214).
  • A bug where string split would drop empty strings if the output was only empty strings has been fixed (#5987).
  • eval no long creates a new local variable scope, but affects variables in the scope it is called from (#4443). source still creates a new local scope.
  • abbr has a new --query option to check for the existence of an abbreviation.
  • Local values for fish_complete_path and fish_function_path are now ignored; only their global values are respected.
  • Syntax error reports now display a marker in the correct position (#5812).
  • Empty universal variables may now be exported (#5992).
  • Exported universal variables are no longer imported into the global scope, preventing shadowing. This makes it easier to change such variables for all fish sessions and avoids breakage when the value is a list of multiple elements (#5258).
  • A bug where for could use invalid variable names has been fixed (#5800).
  • A bug where local variables would not be exported to functions has been fixed (#6153).
  • The null command (:) now always exits successfully, rather than passing through the previous exit status (#6022).
  • The output of functions FUNCTION matches the declaration of the function, correctly including comments or blank lines (#5285), and correctly includes any --wraps flags (#1625).
  • type supports a new option, --short, which suppress function expansion (#6403).
  • type --path with a function argument will now output the path to the file containing the definition of that function, if it exists.
  • type --force-path with an argument that cannot be found now correctly outputs nothing, as documented (#6411).
  • The $hostname variable is no longer truncated to 32 characters (#5758).
  • Line numbers in function backtraces are calculated correctly (#6350).
  • A new fish_cancel event is emitted when the command line is cancelled, which is useful for terminal integration (#5973).

Interactive improvements

  • New Base16 color options are available through the Web-based configuration (#6504).
  • fish only parses /etc/paths on macOS in login shells, matching the bash implementation (#5637) and avoiding changes to path ordering in child shells (#5456). It now ignores blank lines like the bash implementation (#5809).
  • The locale is now reloaded when the LOCPATH variable is changed (#5815).
  • read no longer keeps a history, making it suitable for operations that shouldn't end up there, like password entry (#5904).
  • dirh outputs its stack in the correct order (#5477), and behaves as documented when universal variables are used for its stack (#5797).
  • funced and the edit-commandline-in-buffer bindings did not work in fish 3.0 when the $EDITOR variable contained spaces; this has been corrected (#5625).
  • Builtins now pipe their help output to a pager automatically (#6227).
  • set_color now colors the --print-colors output in the matching colors if it is going to a terminal.
  • fish now underlines every valid entered path instead of just the last one (#5872).
  • When syntax highlighting a string with an unclosed quote, only the quote itself will be shown as an error, instead of the whole argument.
  • Syntax highlighting works correctly with variables as commands (#5658) and redirections to close file descriptors (#6092).
  • help works properly on Windows Subsytem for Linux (#5759, #6338).
  • A bug where disown could crash the shell has been fixed (#5720).
  • fish will not autosuggest files ending with ~ unless there are no other candidates, as these are generally backup files (#985).
  • Escape in the pager works correctly (#5818).
  • Key bindings that call fg no longer leave the terminal in a broken state (#2114).
  • Brackets (#5831) and filenames containing $ (#6060) are completed with appropriate escaping.
  • The output of complete and functions is now colorized in interactive terminals.
  • The Web-based configuration handles aliases that include single quotes correctly (#6120), and launches correctly under Termux (#6248) and OpenBSD (#6522).
  • function now correctly validates parameters for --argument-names as valid variable names (#6147) and correctly parses options following --argument-names, as in "--argument-names foo --description bar" (#6186).
  • History newly imported from bash includes command lines using && or ||.
  • The automatic generation of completions from manual pages is better described in job and process listings, and no longer produces a warning when exiting fish (#6269).
  • In private mode, setting $fish_greeting to an empty string before starting the private session will prevent the warning about history not being saved from being printed (#6299).
  • In the interactive editor, a line break (Enter) inside unclosed brackets will insert a new line, rather than executing the command and producing an error (#6316).
  • Ctrl-C always repaints the prompt (#6394).
  • When run interactively from another program (such as Python), fish will correctly start a new process group, like other shells (#5909).
  • Job identifiers (for example, for background jobs) are assigned more logically (#6053).
  • A bug where history would appear truncated if an empty command was executed was fixed (#6032).

New or improved bindings

  • Pasting strips leading spaces to avoid pasted commands being omitted from the history (#4327).
  • Shift-Left and Shift-Right now default to moving backwards and forwards by one bigword (words separated by whitespace) (#1505).
  • The default escape delay (to differentiate between the escape key and an alt-combination) has been reduced to 30ms, down from 300ms for the default mode and 100ms for Vi mode (#3904).
  • The forward-bigword binding now interacts correctly with autosuggestions (#5336).
  • The fish_clipboard_* functions support Wayland by using wl-clipboard (#5450).
  • The nextd and prevd functions no longer print "Hit end of history", instead using a bell. They correctly store working directories containing symbolic links (#6395).
  • If a fish_mode_prompt function exists, Vi mode will only execute it on mode-switch instead of the entire prompt. This should make it much more responsive with slow prompts (#5783).
  • The path-component bindings (like Ctrl-w) now also stop at ":" and "@", because those are used to denote user and host in commands such as ssh (#5841).
  • The NULL character can now be bound via bind -k nul. Terminals often generate this character via control-space. (#3189).
  • A new readline command expand-abbr can be used to trigger abbreviation expansion (#5762).
  • A new readline command, delete-or-exit, removes a character to the right of the cursor or exits the shell if the command line is empty (moving this functionality out of the delete-or-exit function).
  • The self-insert readline command will now insert the binding sequence, if not empty.
  • A new binding to prepend sudo, bound to Alt-S by default (#6140).
  • The Alt-W binding to describe a command should now work better with multiline prompts (#6110)
  • The Alt-H binding to open a command's man page now tries to ignore sudo (#6122).
  • A new pair of bind functions, history-prefix-search-backward (and forward), was introduced (#6143).
  • Vi mode now supports R to enter replace mode (#6342), and d0 to delete the current line (#6292).
  • In Vi mode, hitting Enter in replace-one mode no longer erases the prompt (#6298).
  • Selections in Vi mode are inclusive, matching the actual behaviour of Vi (#5770).

Improved prompts

  • The Git prompt in informative mode now shows the number of stashes if enabled.
  • The Git prompt now has an option ($__fish_git_prompt_use_informative_chars) to use the (more modern) informative characters without enabling informative mode.
  • The default prompt now also features VCS integration and will color the host if running via SSH (#6375).
  • The default and example prompts print the pipe status if an earlier command in the pipe fails.
  • The default and example prompts try to resolve exit statuses to signal names when appropriate.

Improved terminal output

  • New fish_pager_color_ options have been added to control more elements of the pager's colors (#5524).
  • Better detection and support for using fish from various system consoles, where limited colors and special characters are supported (#5552).
  • fish now tries to guess if the system supports Unicode 9 (and displays emoji as wide), eliminating the need to set $fish_emoji_width in most cases (#5722).
  • Improvements to the display of wide characters, particularly Korean characters and emoji (#5583, #5729).
  • The Vi mode cursor is correctly redrawn when regaining focus under terminals that report focus (eg tmux) (#4788).
  • Variables that control background colors (such as fish_pager_color_search_match) can now use --reverse.

Completions

  • Added completions for
    • aws
    • bat (#6052)
    • bosh (#5700)
    • btrfs
    • camcontrol
    • cf (#5700)
    • chronyc (#6496)
    • code (#6205)
    • cryptsetup (#6488)
    • csc and csi (#6016)
    • cwebp (#6034)
    • cygpath and cygstart (#6239)
    • epkginfo (#5829)
    • ffmpeg, ffplay, and ffprobe (#5922)
    • fsharpc and fsharpi (#6016)
    • fzf (#6178)
    • g++ (#6217)
    • gpg1 (#6139)
    • gpg2 (#6062)
    • grub-mkrescue (#6182)
    • hledger (#6043)
    • hwinfo (#6496)
    • irb (#6260)
    • iw (#6232)
    • kak
    • keepassxc-cli (#6505)
    • keybase (#6410)
    • loginctl (#6501)
    • lz4, lz4c and lz4cat (#6364)
    • mariner (#5718)
    • nethack (#6240)
    • patool (#6083)
    • phpunit (#6197)
    • plutil (#6301)
    • pzstd (#6364)
    • qubes-gpg-client (#6067)
    • resolvectl (#6501)
    • rg
    • rustup
    • sfdx (#6149)
    • speedtest and speedtest-cli (#5840)
    • src (#6026)
    • tokei (#6085)
    • tsc (#6016)
    • unlz4 (#6364)
    • unzstd (#6364)
    • vbc (#6016)
    • zpaq (#6245)
    • zstd, zstdcat, zstdgrep, zstdless and zstdmt (#6364)
  • Lots of improvements to completions.
  • Selecting short options which also have a long name from the completion pager is possible (#5634).
  • Tab completion will no longer add trailing spaces if they already exist (#6107).
  • Completion of subcommands to builtins like and or not now works correctly (#6249).
  • Completion of arguments to short options works correctly when multiple short options are used together (#332).
  • Activating completion in the middle of an invalid completion does not move the cursor any more, making it easier to fix a mistake (#4124).
  • Completion in empty commandlines now lists all available commands.
  • Functions listed as completions could previously leak parts of the function as other completions; this has been fixed.

Deprecations and removed features

  • The vcs-prompt functions have been promoted to names without double-underscore, so __fish_git_prompt is now fish_git_prompt, __fish_vcs_prompt is now fish_vcs_prompt, __fish_hg_prompt is now fish_hg_prompt and __fish_svn_prompt is now fish_svn_prompt. Shims at the old names have been added, and the variables have kept their old names (#5586).
  • string replace has an additional round of escaping in the replacement expression, so escaping backslashes requires many escapes (eg string replace -ra '([ab])' '\\\\\\\$1' a). The new feature flag regex-easyesc can be used to disable this, so that the same effect can be achieved with string replace -ra '([ab])' '\\\\$1' a (#5556). As a reminder, the intention behind feature flags is that this will eventually become the default and then only option, so scripts should be updated.
  • The fish_vi_mode function, deprecated in fish 2.3, has been removed. Use fish_vi_key_bindings instead (#6372).

For distributors and developers

  • fish 3.0 introduced a CMake-based build system. In fish 3.1, both the Autotools-based build and legacy Xcode build system have been removed, leaving only the CMake build system. All distributors and developers must install CMake.
  • fish now depends on the common tee external command, for the psub process substitution function.
  • The documentation is now built with Sphinx. The old Doxygen-based documentation system has been removed. Developers, and distributors who wish to rebuild the documentation, must install Sphinx.
  • The INTERNAL_WCWIDTH build option has been removed, as fish now always uses an internal wcwidth function. It has a number of configuration options that make it more suitable for general use (#5777).
  • mandoc can now be used to format the output from --help if nroff is not installed, reducing the number of external dependencies on systems with mandoc installed (#5489).
  • Some bugs preventing building on Solaris-derived systems such as Illumos were fixed (#5458, #5461, #5611).
  • Completions for npm, bower and yarn no longer require the jq utility for full functionality, but will use Python instead if it is available.
  • The paths for completions, functions and configuration snippets have been extended. On systems that define XDG_DATA_DIRS, each of the directories in this variable are searched in the subdirectories fish/vendor_completions.d, fish/vendor_functions.d, and fish/vendor_conf.d respectively. On systems that do not define this variable in the environment, the vendor directories are searched for in both the installation prefix and the default "extra" directory, which now defaults to /usr/local (#5029).