Versie 4.0.0 van Fish is uitgekomen. Fish, wat staat voor 'friendly interactive shell', is een Unix-shell met een focus op interactiviteit en gebruikersvriendelijkheid. Het kan bijvoorbeeld worden gebruikt als vervanger van Bash. Downloads zijn beschikbaar voor macOS, Linux, BSD en onder Windows is het ook in de Windows Subsystem for Linux te gebruiken. De changelog voor versie 4.0.0 is erg lang en op deze pagina te vinden; we volstaan met het weergeven van de belangrijkste veranderingen:
Notable backwards-incompatible changes
- As part of a larger binding rework,
bind
gained a new key notation. In most cases the old notation should keep working, but in rare cases you may have to change abind
invocation to use the new notation. See below for details.- Ctrl-C now calls a new bind function called
clear-commandline
. The old behavior, which leaves a “^C” marker, is available ascancel-commandline
(#10935)random
will produce different values from previous versions of fish when used with the same seed, and will work more sensibly with small seed numbers. The seed was never guaranteed to give the same result across systems, so we do not expect this to have a large impact (#9593).- Variables in command position that expand to a subcommand keyword are now forbidden to fix a likely user error. For example,
set editor command emacs; $editor
is no longer allowed (#10249).functions --handlers
will now list handlers in a different order. Now it is definition order, first to last, where before it was last to first. This was never specifically defined, and we recommend not relying on a specific order (#9944).- The
qmark-noglob
feature, introduced in fish 3.0, is enabled by default. That means?
will no longer act as a single-character glob. You can, for the time being, turn it back on by addingno-qmark-noglob
tofish_features
and restarting fish:set -Ua fish_features no-qmark-noglobNotable improvements and fixes
- The flag will eventually be made read-only, making it impossible to turn off.
- Terminals that fail to ignore unrecognized OSC or CSI sequences may display garbage. We know cool-retro-term and emacs’ ansi-term are affected, but most mainstream terminals are not.
- fish no longer searches directories from the Windows system/user
$PATH
environment variable for Linux executables. To execute Linux binaries by name (i.e. not with a relative or absolute path) from a Windows folder, make sure the/mnt/c/...
path is explicitly added to$fish_user_paths
and not just automatically appended to$PATH
bywsl.exe
(#10506).- Under Microsoft Windows Subsystem for Linux 1 (not WSL 2), backgrounded jobs that have not been disowned and do not terminate on their own after a
SIGHUP
+SIGCONT
sequence will be explicitly killed by fish on exit (after the usual prompt to close or disown them) to work around a WSL 1 deficiency that sees backgrounded processes that run intoSIGTTOU
remain in a suspended state indefinitely (#5263). The workaround is to explicitlydisown
processes you wish to outlive the shell session.
- fish now requests XTerm’s
modifyOtherKeys
keyboard encoding and kitty keyboard protocol’s progressive enhancements (#10359). Depending on terminal support, this allows to binding more key combinations, including arbitrary combinations of modifiers Ctrl, alt and shift, and distinguishing (for example) Ctrl-i from tab.
Additionally,bind
now supports a human-readable syntax in addition to byte sequences. This includes modifier names, and names for keys like enter and backspace. For exampleAny key argument that starts with an ASCII control character (like
bind up 'do something'
binds the up-arrow key instead of a two-key sequence (“u” and then “p”)bind Ctrl-X,Alt-C 'do something'
binds a sequence of two keys.\e
or\cX
) or is up to 3 characters long, not a named key, and does not contain,
or-
will be interpreted in the old syntax to keep compatibility for the majority of bindings.
Keyboard protocols can be turned off by disabling the “keyboard-protocols” feature flag:set -Ua fish_features no-keyboard-protocols
- This is a temporary measure to work around buggy terminals (#11056), which appear to be relatively rare. Use this if something like “=0” or “=5u” appears in your commandline mysteriously.
- fish can now be built as a self-installing binary (#10367). That means it can be easily built on one system and copied to another, where it can extract supporting files. To do this, run:
cargo install --path . # in a clone of the fish repository # or `cargo build --release` and copy target/release/fish{,_indent,_key_reader} wherever you want- The first time it runs interactively, it will extract all the data files to
~/.local/share/fish/install/
. A specific path can be used for the data files withfish --install=PATH
To uninstall, remove the fish binaries and that directory.
This build system is experimental; the main build system, usingcmake
, remains the recommended approach for packaging and installation to a prefix.- A new function
fish_should_add_to_history
can be overridden to decide whether a command should be added to the history (#10302).- Bindings can now mix special input functions and shell commands, so
bind Ctrl-G expand-abbr "commandline -i \n"
works as expected (#8186).- Special input functions run from bindings via
commandline -f
are now applied immediately, instead of after the currently executing binding (#3031, #10126). For example,commandline -i foo; commandline | grep foo
succeeds now.- Undo history is no longer truncated after every command, but kept for the lifetime of the shell process.
- The Ctrl-R history search now uses glob syntax (#10131).
- The Ctrl-R history search now operates only on the line or command substitution at cursor, making it easier to combine commands from history (#9751).
- Abbreviations can now be restricted to specific commands. For instance:
abbr --add --command git back 'reset --hard HEAD^'- will expand “back” to
reset --hard HEAD^
, but only when the command isgit
(#9411).