3.5.0
版本发布时间: 2022-06-16 19:30:49
fish-shell/fish-shell最新发布版本:3.7.1(2024-03-19 13:29:28)
Notable improvements and fixes
- A new
path
builtin command to filter and transform paths (#7659, #8958). For example, to list all the separate extensions used on files in /usr/share/man (after removing one extension, commonly a “.gz”):
path filter -f /usr/share/man/** | path change-extension '' | path extension | path sort -u
- Tab (or any key bound to
complete
) now expands wildcards instead of invoking completions, if there is a wildcard in the path component under the cursor (#954, #8593). - Scripts can now catch and handle the SIGINT and SIGTERM signals, either via
function --on-signal
or withtrap
(#6649).
Deprecations and removed features
- The
stderr-nocaret
feature flag, introduced in fish 3.0 and enabled by default in fish 3.1, has been made read-only. That means it is no longer possible to disable it, and code supporting the^
redirection has been removed (#8857, #8865).
To recap: fish used to support ^
to redirect stderr, so you could use commands like:
test "$foo" -gt 8 ^/dev/null
to ignore error messages. This made the ^
symbol require escaping and quoting, and was a bit of a weird shortcut considering 2>
already worked, which is only one character longer.
So the above can simply become:
test "$foo" -gt 8 2>/dev/null
- The following feature flags have been enabled by default:
-
regex-easyesc
, which makesstring replace -r
not do a superfluous round of unescaping in the replacement expression. That means e.g. to escape any “a” or “b” in an argument you can usestring replace -ra '([ab])' '\\\\\\\\$1' foobar
instead of needing 8 backslashes.
-
This only affects the replacement expression, not the match expression (the '([ab])'
part in the example).
A survey of plugins on GitHub did not turn up any affected code, so we do not expect this to affect many users.
This flag was introduced in fish 3.1.
* ampersand-nobg-in-token
, which means that &
will not create a background job if it occurs in the middle of a word. For example, echo foo&bar
will print “foo&bar” instead of running echo foo
in the background and then starting bar
as a second job.
Reformatting with fish_indent
would already introduce spaces, turning echo foo&bar
into echo foo & bar
.
This flag was introduced in fish 3.4.
To turn off these flags, add no-regex-easyesc
or no-ampersand-nobg-in-token
to `fish_features`` and restart fish:
set -Ua fish_features no-regex-easyesc
Like stderr-nocaret
, they will eventually be made read-only.
- Most
string
subcommands no longer append a newline to their input if the input didn’t have one (#8473, #3847) - Fish’s escape sequence removal (like for
string length --visible
or to figure out how wide the prompt is) no longer has special support for non-standard color sequences like from Data General terminals, e.g. the Data General Dasher D220 from 1984. This removes a bunch of work in the common case, allowingstring length --visible
to be much faster with unknown escape sequences. We don’t expect anyone to have ever used fish with such a terminal (#8769). - Code to upgrade universal variables from fish before 3.0 has been removed. Users who upgrade directly from fish versions 2.7.1 or before will have to set their universal variables & abbreviations again. (#8781)
- The meaning of an empty color variable has changed (#8793). Previously, when a variable was set but empty, it would be interpreted as the “normal” color. Now, empty color variables cause the same effect as unset variables - the general highlighting variable for that type is used instead. For example:
set -g fish_color_command blue
set -g fish_color_keyword
would previously make keywords “normal” (usually white in a dark terminal). Now it’ll make them blue. To achieve the previous behavior, use the normal color explicitly: set -g fish_color_keyword normal
.
This makes it easier to make self-contained color schemes that don’t accidentally use color that was set before.
fish_config
has been adjusted to set known color variables that a theme doesn’t explicitly set to empty.
-
eval
is now a reserved keyword, so it can’t be used as a function name. This followsset
andread
, and is necessary because it can’t be cleanly shadowed by a function - at the very leasteval set -l argv foo
breaks. Fish will ignore autoload files for it, so left overeval.fish
from previous fish versions won’t be loaded. - The git prompt in informative mode now defaults to skipping counting untracked files, as this was extremely slow. To turn it on, set
__fish_git_prompt_showuntrackedfiles
or set the git config value “bash.showuntrackedfiles” totrue
explicitly (which can be done for individual repositories). The “informative+vcs” sample prompt already skipped display of untracked files, but didn’t do so in a way that skipped the computation, so it should be quite a bit faster in many cases (#8980). - The
__terlar_git_prompt
function, used by the “Terlar” sample prompt, has been rebuilt as a configuration of the normalfish_git_prompt
to ease maintenance, improve performance and add features (like reading per-repo git configuration). Some slight changes remain; users who absolutely must have the same behavior are encouraged to copy the old function (#9011, #7918, #8979).
Scripting improvements
- Quoted command substitution that directly follow a variable expansion (like
echo "$var$(echo x)"
) no longer affect the variable expansion (#8849). - Fish now correctly expands command substitutions that are preceded by an escaped dollar (like
echo \\$(echo)
). This regressed in version 3.4.0. -
math
can now handle underscores (_
) as visual separators in numbers (#8611, #8496):
math 5 + 2_123_252
-
math
’smin
andmax
functions now take a variable number of arguments instead of always requiring 2 (#8644, #8646):
> math min 8,2,4
2
-
read
is now faster as the last process in a pipeline (#8552). -
string join
gained a new--no-empty
flag to skip empty arguments (#8774, #8351). -
read
now only triggers thefish_read
event, not thefish_prompt
event (#8797). It was supposed to work this way in fish 3.2.0 and later, but both events were emitted. - The TTY modes are no longer restored when non-interactive shells exit. This fixes wrong tty modes in pipelines with interactive commands. (#8705).
- Some functions shipped with fish printed error messages to standard output, but they now they rightly go to standard error (#8855).
-
jobs
now correctly reports CPU usage as a percentage, instead of as a number of clock ticks (#8919). -
process-exit
events now fire when the process exits even if the job has not yet exited, fixing a regression in 3.4.1 (#8914).
Interactive improvements
- Fish now reports a special error if a command wasn’t found and there is a non-executable file by that name in
PATH
(#8804). -
less
and other interactive commands would occasionally be stopped when run in a pipeline with fish functions; this has been fixed (#8699). - Case-changing autosuggestions generated mid-token now correctly append only the suffix, instead of duplicating the token (#8820).
-
ulimit
learned a number of new options for the resource limits available on Linux, FreeBSD ande NetBSD, and returns a specific warning if the limit specified is not available on the active operating system (#8823, #8786). - The
vared
command can now successfully edit variables named “tmp” or “prompt” (#8836, #8837). -
time
now emits an error if used after the first command in a pipeline (#8841). -
fish_add_path
now prints a message for skipped non-existent paths when using the-v
flag (#8884). - Since fish 3.2.0, pressing
Control-D
while a command is running would end up inserting a space into the next commandline, which has been fixed (#8871). - A bug that caused multi-line prompts to be moved down a line when pasting or switching modes has been fixed (#3481).
- The Web-based configuration system no longer strips too many quotes in the abbreviation display (#8917, #8918).
- Fish started with
--no-config
will now use the default keybindings (#8493) - When fish inherits a
USER
environment variable value that doesn’t correspond to the current effective user ID, it will now correct it in all cases (#8879, #8583). - Fish sets a new
EUID
variable containing the current effective user id (#8866). -
history search
no longer interprets the search term as an option (#8853) - The status message when a job terminates should no longer be erased by a multiline prompt (#8817)
New or improved bindings
- The
Alt-S
binding will now insertdoas
instead ofsudo
if necessary (#8942). - The
kill-whole-line
special input function now kills the newline preceeding the last line. This makesdd
in vi-mode clear the last line properly. - The new
kill-inner-line
special input function kills the line without any newlines, allowingcc
in vi-mode to clear the line while preserving newlines (#8983). - On terminals that emit special sequences for these combinations,
Shift-Space
is bound likeSpace
, andCtrl-Return
is bound likeReturn
(#8874).
Improved prompts
- A new
Astronaut
prompt (#8775), a multi-line prompt using plain text reminiscent of the Starship.rs prompt.
Completions
- Added completions for:
-
complete
can now be given multiple--condition
options. They will be attempted in the order they were given, and only if all succeed will the completion be made available (as if they were connected with&&
). This helps with caching - fish’s complete system stores the return value of each condition as long as the commandline doesn’t change, so this can reduce the number of conditions that need to be evaluated (#8536, #8967).
Improved terminal support
- Working directory reporting is enabled for kitty (#8806).
- Changing the cursor shape is now enabled by default in iTerm2 (#3696).
For distributors
- libatomic is now correctly detected as necessary when building on RISC-V (#8850, #8851).
- In some cases, the build process found the wrong libintl on macOS. This has been corrected (#5244).
- The paths for completions, functions, and configuration snippets now include
subdirectories
fish/vendor_completions.d
,fish/vendor_functions.d
, andfish/vendor_conf.d
(respectively) withinXDG_DATA_HOME
(or~/.local/share
if not defined) (#8887, #7816).
--
Download links: To download the source code for fish, we suggest the file named "fish-3.5.0.tar.xz". The file downloaded from "Source code (tar.gz)" will not build correctly. The SHA-256 sum of this file is 291e4ec7c6c3fea54dc1aed057ce3d42b356fa6f70865627b2c7dfcecaefd210
. A GPG signature from David Adam (key ID 0x7A67D962D88A709A
) is available as "fish-3.5.0.tar.xz.asc".
1、 fish-3.5.0.app.zip 8.67MB
2、 fish-3.5.0.pkg 7.6MB
3、 fish-3.5.0.tar.xz 3.17MB
4、 fish-3.5.0.tar.xz.asc 833B