fish 3.6.0 (released January 7, 2023)
Notable improvements and fixes
- By default,
Control-Rnow opens the command history in the pager (#602). This is fully searchable and syntax-highlighted, as an alternative to the incremental search seen in other shells. The new special input functionhistory-pagerhas been added for custom bindings. - Abbrevations are more flexible (#9313, #5003, #2287):
- They may optionally replace tokens anywhere on the command line, instead of only commands
- Matching tokens may be described using a regular expression instead of a literal word
- The replacement text may be produced by a fish function, instead of a literal word
- They may position the cursor anywhere in the expansion, instead of at the end
For example:
function multicd
echo cd (string repeat -n (math (string length -- $argv[1]) - 1) ../)
end
abbr --add dotdot --regex '^\.\.+$' --function multicdThis expands .. to cd ../, ... to cd ../../ and .... to cd ../../../ and so on.
Or:
function last_history_item; echo $history[1]; end
abbr -a !! --position anywhere --function last_history_itemwhich expands !! to the last history item, anywhere on the command line, mimicking other shells’ history expansion.
See the documentation for more.
pathgained a newmtimesubcommand to print the modification time stamp for files. For example, this can be used to handle cache file ages (#9057):
> touch foo
> sleep 10
> path mtime --relative foo
10stringgained a newshortensubcommand to shorten strings to a given visible width (#9156):
> string shorten --max 10 "Hello this is a long string"
Hello thi…test(aka[) gained-ot(older than) and-nt(newer than) operators to compare file modification times, and-efto compare whether the arguments are the same file (#3589).- fish will now mark the extent of many errors with a squiggly line, instead of just a caret (
^) at the beginning (#9130). For example:
checks/set.fish (line 471): for: a,b: invalid variable name. See `help identifiers`
for a,b in y 1 z 3
^~^- A new function,
fish_delta, shows changes that have been made in fish’s configuration from the defaults (#9255). set --erasecan now be used with multiple scopes at once, likeset -efglU foo(#7711, #9280).statusgained a new subcommand,current-commandline, which retrieves the entirety of the currently-executing command line when called from a function during execution. This allows easier job introspection (#8905, #9296).
Deprecations and removed features
- The
\\xand\\Xescape syntax is now equivalent.\\xABpreviously behaved the same as\\XAB, except that it would error if the value “AB” was larger than “7f” (127 in decimal, the highest ASCII value) (#9247, #9245, #1352). - The
fish_git_promptwill now only turn on features if the appropriate variable has been set to a true value (of “1”, “yes” or “true”) instead of just checking if it is defined. This allows specifically turning features off without having to erase variables, such as via universal variables. If you have defined a variable to a different value and expect it to count as true, you need to change it (#9274).
For example,set -g __fish_git_prompt_show_informative_status 0previously would have enabled informative status (because any value would have done so), but now it turns it off. - Abbreviations are no longer stored in universal variables. Existing universal abbreviations are still imported, but new abbreviations should be added to
config.fish. - The short option
-rfor abbreviations has changed fromrenametoregex, for consistency withstring.
Scripting improvements
argparsecan now be used without option specifications, to allow using--min-args,--max-argsor for commands that take no options (but might in future) (#9006):
function my_copy
argparse --min-args 2 -- $argv
or return
cp $argv
endset --shownow shows when a variable was inherited from fish’s parent process, which should help with debugging (#9029):
> set --show XDG_DATA_DIRS
$XDG_DATA_DIRS: set in global scope, exported, a path variable with 4 elements
$XDG_DATA_DIRS[1]: |/home/alfa/.local/share/flatpak/exports/share|
$XDG_DATA_DIRS[2]: |/var/lib/flatpak/exports/share|
$XDG_DATA_DIRS[3]: |/usr/local/share|
$XDG_DATA_DIRS[4]: |/usr/share|
$XDG_DATA_DIRS: originally inherited as |/home/alfa/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/|- The read limit is now restored to the default when
fish_read_limitis unset (#9129). mathproduces an error for division-by-zero, as well as augmenting some errors with their extent (#9190). This changes behavior in some limited cases, such as:
math min 1 / 0, 5which would previously print “5” (because in floating point division “1 / 0” yields infinite, and 5 is smaller than infinite) but will now return an error.
fish_clipboard_copyandfish_clipboard_pastecan now be used in pipes (#9271):
git rev-list 3.5.1 | fish_clipboard_copy
fish_clipboard_paste | string join + | mathstatus fish-pathreturns a fully-normalised path, particularly noticeable on NetBSD (#9085).
Interactive improvements
- If the terminal definition for
TERMcan’t be found, fish now tries using the “xterm-256color” and “xterm” definitions before “ansi” and “dumb”. As the majority of terminal emulators in common use are now more or less xterm-compatible (often even explicitly claiming the xterm-256color entry), this should often result in a fully or almost fully usable terminal (#9026). - A new variable,
fish_cursor_selection_mode, can be used to configure whether the command line selection includes the character under the cursor (inclusive) or not (exclusive). The new default isexclusive; useset fish_cursor_selection_mode inclusiveto get the previous behavior back (#7762). - fish’s completion pager now fills half the terminal on first tab press instead of only 4 rows, which should make results visible more often and save key presses, without constantly snapping fish to the top of the terminal (#9105, #2698).
- The
complete-and-searchbinding, used withShift-Tabby default, selects the first item in the results immediately (#9080). bindoutput is now syntax-highlighted when used interacively.Alt-H(the default__fish_man_page binding) does a better job of showing the manual page of the command under cursor (#9020).- If
fish_color_valid_pathcontains an actual color instead of just modifiers, those will be used for valid paths even if the underlying color isn’t “normal” (#9159). - The key combination for the QUIT terminal sequence, often
Control-Backslash(\\x1c), can now be sused as a binding (#9234). - fish’s vi mode uses normal xterm-style sequences to signal cursor change, instead of using the iTerm’s proprietary escape sequences. This allows for a blinking cursor and makes it work in complicated scenarios with nested terminals. (#3741, #9172)
- When running fish on a remote system (such as inside SSH or a container),
Control-Xnow copies to the local client system’s clipboard if the terminal supports OSC 52. commandlinegained two new options,--selection-startand--selection-end, to set the start/end of the current selection (#9197, #9215).- fish’s builtins now handle keyboard interrupts (
Control-C) correctly (#9266).
Completions
- Added completions for:
arkasciinema(#9257)clojure(#9272)cshdirenv(#9268)dive(#9082)dolphindua(#9277)efivar(#9318)eges(#9388)firefox-developer-editionandfirefox(#9090)fortune(#9177)kbkind(#9110)konsolekshloadkeys(#9312)okularop(#9300)ouch(#9405)pixreadelf(#8746, #9386)qshellrcsad(#9145)tcshtoottox(#9078)wishxedxonsh(#9389)xplayerxreaderxvieweryash(#9391)zig(#9083)
- Improvements to many completions, including making
cdcompletion much faster (#9220). - Completion of tilde (
~) works properly even when the file name contains an escaped character (#9073). - fish no longer loads completions if the command is used via a relative path and is not in
PATH(#9133). - fish no longer completes inside of comments (#9320).
Improved terminal support
- Opening
helpon WSL now uses PowerShell to open the browser if available, removing some awkward UNC path errors (#9119).
Other improvements
- The Web-based configuration tool now works on systems with IPv6 disabled (#3857).
- Aliases can ignore arguments by ending them with
#(#9199). stringis now faster when reading large strings from stdin (#9139).string repeatuses less memory and is faster. (#9124)- Builtins are much faster when writing to a pipe or file. (#9229).
- Performance improvements to highlighting (#9180) should make using fish more pleasant on slow systems.
- On 32-bit systems, globs like
\*will no longer fail to return some files, as large file support has been enabled.
Fixed bugs
- The history search text for a token search is now highlighted correctly if the line contains multiple instances of that text (#9066).
process-exitandjob-exitevents are now generated for all background jobs, including those launched from event handlers (#9096).- A crash when completing a token that contained both a potential glob and a quoted variable expansion was fixed (#9137).
prompt_pwdno longer accidentally overwrites a global or universal$fish_prompt_pwd_full_dirswhen called with the-dor--full-length-dirsoption (#9123).- A bug which caused fish to freeze or exit after running a command which does not preserve the foreground process group was fixed (#9181).
- The “Disco” sample prompt no longer prints an error in some working directories (#9164). If you saved this prompt, you should run
fish_config prompt save discoagain. - fish launches external commands via the given path again, rather than always using an absolute path. This behaviour was inadvertently changed in 3.5.0 and is visible, for example, when launching a bash script which checks
$0(#9143). printfno longer tries to interpret the first argument as an option (#9132).- Interactive
readin scripts will now have the correct keybindings again (#9227). - A possible stack overflow when recursively evaluating substitutions has been fixed (#9302).
- A crash with relative $CDPATH has been fixed (#9407).
printfnow properly fills extra%dspecifiers with 0 even on macOS and BSD (#9321).fish_key_readernow correctly exits when receiving a SIGHUP (like after closing the terminal) (#9309).fish_config theme savenow works as documented instead of erroring out (#9088, #9273).- fish no longer triggers prompts to install command line tools when first run on macOS (#9343).
fish_git_promptnow quietly fails on macOS if the xcrun cache is not yet populated (#6625), working around a potential hang.
For distributors
- The vendored PCRE2 sources have been removed. It is recommended to declare PCRE2 as a dependency when packaging fish. If the CMake variable FISH_USE_SYSTEM_PCRE2 is false, fish will now download and build PCRE2 from the official repo (#8355, #8363). Note this variable defaults to true if PCRE2 is found installed on the system.
Download links: To download the source code for fish, we suggest the file named "fish-3.6.0.tar.xz". The file downloaded from "Source code (tar.gz)" will not build correctly. The SHA-256 sum of this file is 97044d57773ee7ca15634f693d917ed1c3dc0fa7fde1017f1626d60b83ea6181. A GPG signature from David Adam (key ID 0x7A67D962D88A709A) is available as "fish-3.6.0.tar.xz.asc".