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_prompt
is set to 1, fish will reexecute prompt functions with the--final-rendering
argument 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 install
no 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=COLOR
no 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
TERM
environment variable (#11344). For the time being, this change can be reversed via theignore-terminfo
feature flag. To do so, run the following once and restart fish:set -Ua fish_features no-ignore-terminfoScripting improvements
- The
--install
option when fish is built as self-installing is removed, see below.set_color ff0000
now outputs 24-bit RGB true-color even ifCOLORTERM
is unset. One can override this by settingfish_term24bit
to 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-term
and 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/--center
option.- The psub command now allows combining
--suffix
with--fifo
(#11729).- The read builtin has learned the
--tokenize-raw
option 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 useman
directly, meaning that variables likeMANWIDTH
are respected (#11786).funced
will now edit copied functions directly, instead of the file wherefunction --copy
was invoked. (#11614)- Added a simple
fish_jj_prompt
which 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
run0
if available.- Some mouse support has been added: the OSC 133 prompt marking feature has learned about kitty’s
click_events=1
flag, 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
git
completions now show the remote URL as description when completing remotes.systemctl
completions no longer print escape codes ifSYSTEMD_COLORS
happens 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-tree
now 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}.sh
andtests/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
--help
option now require theman
program. The direct dependency onmandoc
andnroff
has 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
PATH
or 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_dir
variable 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/null
instead). 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,
help
will redirect to e.g. https://fishshell.com/docs/current/fish_indent
andfish_key_reader
as separate files, making them easily accessible outside fish- an (empty)
/etc/fish/config.fish
as well as empty directories/etc/fish/{functions,completions,conf.d}
$PREFIX/share/pkgconfig/fish.pc
, which defines directories for configuration-snippets, likevendor_completions.d
We 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 builtinLANGUAGE
environment 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 withoutmsgfmt
available, 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-messages
cargo feature will cause fish to be built without localization support. CMake builds can continue to use theWITH_GETTEXT
option, with the same semantics as thelocalize-messages
feature. 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 thepo
directory before building to exclude unwanted languages.
argparse
now saves recognised options, including option-arguments inargv_opts
, allowing them to be forwarded to other commands (#6466).argparse
options 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
/--delete
option tofish_opt
.argparse --ignore-unknown
now removes preceding known short options from groups containing unknown options (e.g. when parsing-abc
, ifa
is known butb
is not, thenargv
will contain-bc
).argparse
now has an-u
/--move-unknown
option that works like--ignore-unknown
but preserves unknown options inargv
.argparse
now has an-S
/--strict-longopts
option that forbids abbreviating long options or passing them with a single dash (e.g. if there is a long option calledfoo
,--fo
and--foo
won’t match it).argparse
now has a-U
/--unknown-arguments
option to specify how to parse unknown option’s arguments.argparse
now allows specifying options that take multiple optional values by using=*
in the option spec (#8432). In addition,fish_opt
has been modified to support such options by using the--multiple-vals
together with-o
/--optional-val
;-m
is also now acceptable as an abbreviation for--multiple-vals
.fish_opt
no longer requires you give a short flag name when defining options, provided you give it a long flag name with more than one character.argparse
option 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-only
option tofish_opt
is now no longer necessary and is deprecated.fish_opt
now has a-v
/--validate
option you can use to give a fish script to validate values of the option.