
Versie 4.1.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 deze uitgave kan hieronder worden gevonden.
Notable improvements and fixesDeprecations and removed features
- Compound commands (
begin; echo 1; echo 2; end) can now be written using braces ({ echo1; echo 2 }), like in other shells.- fish now supports transient prompts: if
fish_transient_promptis set to 1, fish will reexecute prompt functions with the--final-renderingargument before running a commandline (#11153).- Tab completion results are truncated up to the common directory path, instead of somewhere inside that path. E.g. if you complete “share/functions”, and it includes the files “foo.fish” and “bar.fish”, the completion pager will now show “…/foo.fish” and “…/bar.fish” (#11250).
- Self-installing builds as created by e.g.
cargo installno longer install other files, see below.- Our gettext-based message-localization has been reworked, adding translations to self-installing builds; see below.
set_color --background=COLORno longer implicitly activates bold mode. If your theme is stored in universal variables (the historical default), some bold formatting might be lost. To fix this, we suggest updating to the latest version of our theme, to explicitly activate bold mode, for example usefish_config theme save "fish default".{echo,echo}or{ echo, echo }are no longer interpreted as brace expansion tokens but as compound commands.- Terminfo-style key names (
bind -k nul) are no longer supported. They had been superseded by fish’s own key names since 4.0 (#11342).- fish no longer reads the terminfo database, so its behavior is generally no longer affected by the
TERMenvironment variable (#11344). For the time being, this change can be reversed via theignore-terminfofeature flag. To do so, run the following once and restart fish:set -Ua fish_features no-ignore-terminfoScripting improvements
- The
--installoption when fish is built as self-installing is removed, see below.set_color ff0000now outputs 24-bit RGB true-color even ifCOLORTERMis unset. One can override this by settingfish_term24bitto 0 (#11372).- fish now requires the terminal to respond to queries for the primary device attribute. For now, this can be reversed via a feature flag, by running (once)
set -Ua fish_features no-query-termand restarting fish.- Users of GNU screen may experience minor glitches when starting fish.
Interactive improvements
- The argparse builtin has seen many improvements, see below.
- The string pad command now has a
-C/--centeroption.- The psub command now allows combining
--suffixwith--fifo(#11729).- The read builtin has learned the
--tokenize-rawoption to tokenize without quote removal (#11084).New or improved bindings
- Autosuggestions are now also provided in multi-line command lines. Like ctrl-r, these operate only on the current line.
- Autosuggestions used to not suggest multi-line command-lines from history; now autosuggestions include individual lines from multi-line command-lines.
- The history pager search now preserves ordering between ctrl-s forward and ctrl-r backward searches.
- Instead of highlighting events by flashing all text to the left of the cursor, failing history token search (alt-.) flashes the associated token, failing tab-completion flashes the to-be-completed token (#11050), deleting an autosuggestion (shift-delete) flashes the suggestion, and all other scenarios flash the full command line.
- Pasted commands are now stripped of any
$command prefixes, to help pasting code snippets.- Builtin help options (e.g.
abbr --help) now usemandirectly, meaning that variables likeMANWIDTHare respected (#11786).funcedwill now edit copied functions directly, instead of the file wherefunction --copywas invoked. (#11614)- Added a simple
fish_jj_promptwhich reduces visual noise in the prompt inside Jujutsu repositories that are colocated with Git.Completions
- On non-macOS systems, alt-left, alt-right, alt-backspace and alt-delete no longer operate on punctuation-delimited words but on whole arguments, possibly including special characters like
/and quoted spaces. On macOS, the corresponding ctrl- prefixed keys operate on whole arguments. Word operations are still available via the other respective modifier, just like in most web browsers.- ctrl-z (undo) after executing a command will restore the previous cursor position instead of placing the cursor at the end of the command line.
- The alt-s binding will now also use
run0if available.- Some mouse support has been added: the OSC 133 prompt marking feature has learned about kitty’s
click_events=1flag, which allows moving fish’s cursor by clicking in the command line, and selecting pager items (#10932).- Before clearing the screen and redrawing, ctrl-l now pushes all text located above the prompt to the terminal’s scrollback, via a new special input function scrollback-push. For compatibility with terminals that do not implement ECMA-48’s SCROLL UP command, this function is only used if the terminal advertises support for that via XTGETTCAP.
- Vi mode has learned ctrl-a (increment) and ctrl-x (decrement) (#11570).
Improved terminal support
gitcompletions now show the remote URL as description when completing remotes.systemctlcompletions no longer print escape codes ifSYSTEMD_COLORShappens to be set (#11465).- Added and improved many completion scripts, notably
tmux.Other improvements
- Support for double, curly, dotted and dashed underlines, for use in
fish_color_*variables and the set_color builtin (#10957).- Underlines can now be colored independent of text (#7619).
- New documentation page Terminal Compatibility (also accessible via
man fish-terminal-compatibility) lists the terminal control sequences used by fish.- fish now requires the terminal to respond to queries for the primary device attribute. For now, this can be reversed via a feature flag, by running (once)
set -Ua fish_features no-query-term.For distributors
- Updated Chinese and German translations.
fish_indent --dump-parse-treenow emits simple metrics about the tree including its memory consumption.- We added some tools to improve development workflows, for example
build_tools/{check,update_translations,release}.shandtests/test_driver.py. In conjunction withcargo, these enable almost all day-to-day development tasks without using CMake.Changes to self-installing builds
- Builtin commands that support the
--helpoption now require themanprogram. The direct dependency onmandocandnroffhas been removed.- fish no longer uses gettext MO files, see below. If you have use cases which are incompatible with our new approach, please let us know.
- The fish_indent and fish_key_reader programs are now also available as builtins. If fish is invoked via e.g. a symlink with one of these names, it will act like the given tool (i.e. it’s a multi-call binary). This allows truly distributing fish as a single file (#10876).
- The CMake build configuration has been simplified and no longer second-guesses rustup. It will run rustc and cargo via
PATHor in ~/.cargo/bin/. If that doesn’t match your setup, set the Rust_COMPILER and Rust_CARGO CMake variables (#11328).- Cygwin support has been reintroduced, since Rust gained a Cygwin target (#11238).
- CMake 3.15 is now required.
The self-installing build type introduced in fish 4.0 has been changed (#11143). Now fish built with embedded data will just read the data straight from its own binary or write it out to temporary files when necessary, instead of requiring an installation step on start. That means it is now possible to build fish as a single file and copy it to any system with a compatible CPU architecture, including as a different user, without extracting any files. As before, this is the default when building via
cargo, and disabled when building via CMake. For packagers we continue to recommend CMake.Note: When fish is built like this, the
__fish_data_dirvariable will be empty because that directory no longer has meaning. You should generally not need these files. For example, if you want to make sure that completions for “foo” are loaded, usecomplete -C"foo " >/dev/nullinstead). The raw files are still exposed via status subcommands, mainly for fish’s internal use, but you can also use them as a last resort.Remaining benefits of a full installation (as currently done by CMake) are:
Changes to gettext localization
- man pages like
fish(1)in standard locations, easily accessible from outside fish.- a local copy of the HTML documentation, typically accessed via the help function. In builds with embedded data,
helpwill redirect to e.g. https://fishshell.com/docs/current/fish_indentandfish_key_readeras separate files, making them easily accessible outside fish- an (empty)
/etc/fish/config.fishas well as empty directories/etc/fish/{functions,completions,conf.d}$PREFIX/share/pkgconfig/fish.pc, which defines directories for configuration-snippets, likevendor_completions.dWe replaced several parts of the gettext functionality with custom implementations (#11726). Most notably, message extraction, which should now work reliably, and the runtime implementation, where we no longer dynamically link to gettext, but instead use our own implementation, whose behavior is similar to GNU gettext, with some minor deviations. Our implementation now fully respects fish variables, so locale variables do not have to be exported for fish localizations to work. They still have to be exported to inform other programs about language preferences. The
Changes to the argparse builtinLANGUAGEenvironment variable is now treated as a path variable, meaning it is an implicitly colon-separated list. While we no longer have any runtime dependency on gettext, we still need gettext tools for building, most notablymsgfmt. When building withoutmsgfmtavailable, localization will not work with the resulting executable. Localization data is no longer sourced at runtime from MO files on the file system, but instead built into the executable. This is always done, independently of the other data embedding, so all fish executables will have access to all message catalogs, regardless of the state of the file system. Disabling our newlocalize-messagescargo feature will cause fish to be built without localization support. CMake builds can continue to use theWITH_GETTEXToption, with the same semantics as thelocalize-messagesfeature. The current implementation does not provide any configuration options for controlling which language catalogs are built into the executable (other than disabling them all). As a workaround, you can delete files in thepodirectory before building to exclude unwanted languages.
argparsenow saves recognised options, including option-arguments inargv_opts, allowing them to be forwarded to other commands (#6466).argparseoptions can now be marked to be deleted fromargv_opts(by adding a&at the end of the option spec, before a!if present). There is now also a corresponding-d/--deleteoption tofish_opt.argparse --ignore-unknownnow removes preceding known short options from groups containing unknown options (e.g. when parsing-abc, ifais known butbis not, thenargvwill contain-bc).argparsenow has an-u/--move-unknownoption that works like--ignore-unknownbut preserves unknown options inargv.argparsenow has an-S/--strict-longoptsoption that forbids abbreviating long options or passing them with a single dash (e.g. if there is a long option calledfoo,--foand--foowon’t match it).argparsenow has a-U/--unknown-argumentsoption to specify how to parse unknown option’s arguments.argparsenow allows specifying options that take multiple optional values by using=*in the option spec (#8432). In addition,fish_opthas been modified to support such options by using the--multiple-valstogether with-o/--optional-val;-mis also now acceptable as an abbreviation for--multiple-vals.fish_optno longer requires you give a short flag name when defining options, provided you give it a long flag name with more than one character.argparseoption specifiers for long-only options can now start with/, allowing the definition of long options with a single letter. Due to this change, the--long-onlyoption tofish_optis now no longer necessary and is deprecated.fish_optnow has a-v/--validateoption you can use to give a fish script to validate values of the option.
