|
fish 3.5.0 (released June 16, 2022)
===================================
Notable improvements and fixes
------------------------------
- A new ``path`` builtin command to filter and transform paths (:issue:`7659`, :issue:`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 (:issue:`954`, :issue:`8593`).
- Scripts can now catch and handle the SIGINT and SIGTERM signals, either via ``function --on-signal`` or with ``trap`` (:issue:`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 (:issue:`8857`, :issue:`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 makes ``string 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 use ``string 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 :envvar:`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 (:issue:`8473`, :issue:`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, allowing ``string length --visible`` to be much faster with unknown escape sequences. We don't expect anyone to have ever used fish with such a terminal (:issue:`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. (:issue:`8781`)
- The meaning of an empty color variable has changed (:issue:`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 follows ``set`` and ``read``, and is necessary because it can't be cleanly shadowed by a function - at the very least ``eval set -l argv foo`` breaks. Fish will ignore autoload files for it, so left over ``eval.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 :envvar:`__fish_git_prompt_showuntrackedfiles` or set the git config value "bash.showuntrackedfiles" to ``true`` 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 (:issue:`8980`).
- The ``__terlar_git_prompt`` function, used by the "Terlar" sample prompt, has been rebuilt as a configuration of the normal ``fish_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 (:issue:`9011`, :issue:`7918`, :issue:`8979`).
Scripting improvements
----------------------
- Quoted command substitution that directly follow a variable expansion (like ``echo "$var$(echo x)"``) no longer affect the variable expansion (:issue:`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 (:issue:`8611`, :issue:`8496`)::
math 5 + 2_123_252
- ``math``'s ``min`` and ``max`` functions now take a variable number of arguments instead of always requiring 2 (:issue:`8644`, :issue:`8646`)::
> math min 8,2,4
2
- ``read`` is now faster as the last process in a pipeline (:issue:`8552`).
- ``string join`` gained a new ``--no-empty`` flag to skip empty arguments (:issue:`8774`, :issue:`8351`).
- ``read`` now only triggers the ``fish_read`` event, not the ``fish_prompt`` event (:issue:`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. (:issue:`8705`).
- Some functions shipped with fish printed error messages to standard output, but they now they rightly go to standard error (:issue:`8855`).
- ``jobs`` now correctly reports CPU usage as a percentage, instead of as a number of clock ticks (:issue:`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 (:issue:`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 :envvar:`PATH` (:issue:`8804`).
- ``less`` and other interactive commands would occasionally be stopped when run in a pipeline with fish functions; this has been fixed (:issue:`8699`).
- Case-changing autosuggestions generated mid-token now correctly append only the suffix, instead of duplicating the token (:issue:`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 (:issue:`8823`, :issue:`8786`).
- The ``vared`` command can now successfully edit variables named "tmp" or "prompt" (:issue:`8836`, :issue:`8837`).
- ``time`` now emits an error if used after the first command in a pipeline (:issue:`8841`).
- ``fish_add_path`` now prints a message for skipped non-existent paths when using the ``-v`` flag (:issue:`8884`).
- Since fish 3.2.0, pressing :kbd:`Control-D` while a command is running would end up inserting a space into the next commandline, which has been fixed (:issue:`8871`).
- A bug that caused multi-line prompts to be moved down a line when pasting or switching modes has been fixed (:issue:`3481`).
- The Web-based configuration system no longer strips too many quotes in the abbreviation display (:issue:`8917`, :issue:`8918`).
- Fish started with ``--no-config`` will now use the default keybindings (:issue:`8493`)
- When fish inherits a :envvar:`USER` environment variable value that doesn't correspond to the current effective user ID, it will now correct it in all cases (:issue:`8879`, :issue:`8583`).
- Fish sets a new :envvar:`EUID`` variable containing the current effective user id (:issue:`8866`).
- ``history search`` no longer interprets the search term as an option (:issue:`8853`)
- The status message when a job terminates should no longer be erased by a multiline prompt (:issue:`8817`)
New or improved bindings
^^^^^^^^^^^^^^^^^^^^^^^^
- The :kbd:`Alt-S` binding will now insert ``doas`` instead of ``sudo`` if necessary (:issue:`8942`).
- The ``kill-whole-line`` special input function now kills the newline preceeding the last line. This makes ``dd`` in vi-mode clear the last line properly.
- The new ``kill-inner-line`` special input function kills the line without any newlines, allowing ``cc`` in vi-mode to clear the line while preserving newlines (:issue:`8983`).
- On terminals that emit special sequences for these combinations, :kbd:`Shift-Space` is bound like :kbd:`Space`, and :kbd:`Ctrl-Return` is bound like :kbd:`Return` (:issue:`8874`).
Improved prompts
^^^^^^^^^^^^^^^^
- A new ``Astronaut`` prompt (:issue:`8775`), a multi-line prompt using plain text reminiscent of the Starship.rs prompt.
Completions
^^^^^^^^^^^
- Added completions for:
- ``archlinux-java`` (:issue:`8911`)
- ``apk`` (:issue:`8951`)
- ``brightnessctl`` (:issue:`8758`)
- ``efibootmgr`` (:issue:`9010`)
- ``fastboot`` (:issue:`8904`)
- ``optimus-manager`` (:issue:`8913`)
- ``rclone`` (:issue:`8819`)
- ``sops`` (:issue:`8821`)
- ``tuned-adm`` (:issue:`8760`)
- ``wg-quick`` (:issue:`8687`)
- ``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 (:issue:`8536`, :issue:`8967`).
Improved terminal support
^^^^^^^^^^^^^^^^^^^^^^^^^
- Working directory reporting is enabled for kitty (:issue:`8806`).
- Changing the cursor shape is now enabled by default in iTerm2 (:issue:`3696`).
For distributors
----------------
- libatomic is now correctly detected as necessary when building on RISC-V (:issue:`8850`, :issue:`8851`).
- In some cases, the build process found the wrong libintl on macOS. This has been corrected (:issue:`5244`).
- The paths for completions, functions, and configuration snippets now include
subdirectories ``fish/vendor_completions.d``, ``fish/vendor_functions.d``, and
``fish/vendor_conf.d`` (respectively) within ``XDG_DATA_HOME`` (or ``~/.local/share``
if not defined) (:issue:`8887`, :issue:`7816`).
|
|
While here fix a C++ <version> build issue seen on macOS.
fish 3.3.1 (released July 6, 2021)
==================================
This release of fish fixes the following problems identified in fish 3.3.0:
- The prompt and command line are redrawn correctly in response to universal
variable changes (:issue:`8088`).
- A superfluous error that was produced when setting the ``PATH`` or ``CDPATH``
environment variables to include colon-delimited components that do not exist
was removed (:issue:`8095`).
- The Vi mode indicator in the prompt is repainted correctly after
:kbd:`Ctrl-C` cancels the current command (:issue:`8103`).
- fish builds correctly on platforms that do not have a ``spawn.h`` header,
such as old versions of OS X (:issue:`8097`).
A number of improvements to the documentation, and fixes for completions, are
included as well.
If you are upgrading from version 3.2.2 or before, please also review the
release notes for 3.3.0 (included below).
fish 3.3.0 (released June 28, 2021)
===================================
Notable improvements and fixes
------------------------------
- ``fish_config`` gained a ``prompt`` subcommand to show and pick from the
sample prompts directly in the terminal, instead of having to open a
webbrowser. For example ``fish_config prompt choose default`` loads the
default prompt in the current session (:issue:`7958`).
- The documentation has been reorganized to be easier to understand
(:issue:`7773`).
Deprecations and removed features
---------------------------------
- The ``$fish_history`` value "default" is no longer special. It used to be
treated the same as "fish" (:issue:`7650`).
- Redirection to standard error with the ``^`` character has been disabled by
default. It can be turned back on using the ``stderr-nocaret`` feature flag,
but will eventually be disabled completely (:issue:`7105`).
- Specifying an initial tab to ``fish_config`` now only works with
``fish_config browse`` (e.g. ``fish_config browse variables``), otherwise it
would interfere with the new ``prompt`` subcommand (see below)
(:issue:`7958`).
Scripting improvements
----------------------
- ``math`` gained new functions ``log2`` (like the documentation claimed),
``max`` and ``min`` (:issue:`7856`). ``math`` functions can be used without
the parentheses (eg ``math sin 2 + 6``), and functions have the lowest
precedence in the order of operations (:issue:`7877`).
- Shebang (``#!``) lines are no longer required within shell scripts, improving
support for scripts with concatenated binary contents. If a file fails to
execute and passes a (rudimentary) binary safety check, fish will re-invoke
it using ``/bin/sh`` (:issue:`7802`).
- Exit codes are better aligned with bash. A failed execution now reports
``$status`` of 127 if the file is not found, and 126 if it is not executable.
- ``echo`` no longer writes its output one byte at a time, improving
performance and allowing use with Linux's special API files (``/proc``,
``/sys`` and such) (:issue:`7836`).
- fish should now better handle ``cd`` on filesystems with broken ``stat(3)``
responses (:issue:`7577`).
- Builtins now properly report a ``$status`` of 1 upon unsuccessful writes
(:issue:`7857`).
- ``string match`` with unmatched capture groups and without the ``--all`` flag
now sets an empty variable instead of a variable containing the empty string.
It also correctly imports the first match if multiple arguments are provided,
matching the documentation. (:issue:`7938`).
- fish produces more specific errors when a command in a command substitution
wasn't found or is not allowed. This now prints something like "Unknown
command" instead of "Unknown error while evaluating command substitution".
- ``fish_indent`` allows inline variable assignments (``FOO=BAR command``) to
use line continuation, instead of joining them into one line (:issue:`7955`).
- fish gained a ``--no-config`` option to disable configuration files. This
applies to user-specific and the systemwide ``config.fish`` (typically in
``/etc/fish/config.fish``), and configuration snippets (typically in
``conf.d`` directories). It also disables universal variables, history, and
loading of functions from system or user configuration directories
(:issue:`7921`, :issue:`1256`).
- When universal variables are unavailable for some reason, setting a universal
variable now sets a global variable instead (:issue:`7921`).
- ``$last_pid`` now contains the process ID of the last process in the
pipeline, allowing it to be used in scripts (:issue:`5036`, :issue:`5832`,
:issue:`7721`). Previously, this value contained the process group ID, but in
scripts this was the same as the running fish's process ID.
- ``process-exit`` event handlers now receive the same value as ``$status`` in
all cases, instead of receiving -1 when the exit was due to a signal.
- ``process-exit`` event handlers for PID 0 also received ``JOB_EXIT`` events;
this has been fixed.
- ``job-exit`` event handlers may now be created with any of the PIDs from the
job. The handler is passed the last PID in the job as its second argument,
instead of the process group.
- Trying to set an empty variable name with ``set`` no longer works (these
variables could not be used in expansions anyway).
- ``fish_add_path`` handles an undefined ``PATH`` environment variable
correctly (:issue:`8082`).
Interactive improvements
-------------------------
- Commands entered before the previous command finishes will now be properly
syntax highlighted.
- fish now automatically creates ``config.fish`` and the configuration
directories in ``$XDG_CONFIG_HOME/fish`` (by default ``~/.config/fish``) if
they do not already exist (:issue:`7402`).
- ``$SHLVL`` is no longer incremented in non-interactive shells. This means it
won't be set to values larger than 1 just because your environment happens to
run some scripts in $SHELL in its startup path (:issue:`7864`).
- fish no longer rings the bell when flashing the command line. The flashing
should already be enough notification and the bell can be annoying
(:issue:`7875`).
- ``fish --help`` is more helpful if the documentation isn't installed
(:issue:`7824`).
- ``funced`` won't include an entry on where a function is defined, thanks to
the new ``functions --no-details`` option (:issue:`7879`).
- A new variable, ``fish_killring``, containing entries from the killring, is
now available (:issue:`7445`).
- ``fish --private`` prints a note on private mode on startup even if
``$fish_greeting`` is an empty list (:issue:`7974`).
- fish no longer attempts to lock history or universal variable files on remote
filesystems, including NFS and Samba mounts. In rare cases, updates to these
files may be dropped if separate fish instances modify them simultaneously.
(:issue:`7968`).
- ``wait`` and ``on-process-exit`` work correctly with jobs that have already
exited (:issue:`7210`).
- ``__fish_print_help`` (used for ``--help`` output for fish's builtins) now
respects the ``LESS`` environment variable, and if not set, uses better
default pager settings (:issue:`7997`).
- Errors from ``alias`` are now printed to standard error, matching other
builtins and functions (:issue:`7925`).
- ``ls`` output is colorized on OpenBSD if colorls utility is installed
(:issue:`8035`)
- The default pager color looks better in terminals with light backgrounds
(:issue:`3412`).
- Further robustness improvements to the bash history import (:issue:`7874`).
- fish now tries to find a Unicode-aware locale for encoding (``LC_CTYPE``) if
started without any locale information, improving the display of emoji and
other non-ASCII text on misconfigured systems (:issue:`8031`). To allow a C
locale, set the variable ``fish_allow_singlebyte_locale`` to 1.
- The Web-based configuration and documentation now feature a dark mode if the
browser requests it (:issue:`8043`).
- Color variables can now also be given like ``--background red`` and ``-b
red``, not just ``--background=red`` (:issue:`8053`).
- ``exit`` run within ``fish_prompt`` now exits properly (:issue:`8033`).
- When attempting to execute the unsupported POSIX-style brace command group
(``{ ... }``) fish will suggest its equivalent ``begin; ...; end`` commands
(:issue:`6415`).
New or improved bindings
^^^^^^^^^^^^^^^^^^^^^^^^
- Pasting in Vi mode puts text in the right place in normal mode
(:issue:`7847`).
- Vi mode's :kbd:`u` is bound to ``undo`` instead of
``history-search-backward``, following GNU readline's behavior. Similarly,
:kbd:`Control-R` is bound to ``redo`` instead of ``history-search-backward``,
following Vim (:issue:`7908`).
- :kbd:`s` in Vi visual mode now does the same thing as :kbd:`c`
(:issue:`8039`).
- The binding for :kbd:`"*y` now uses ``fish_clipboard_copy``, allowing it to
support more than just ``xsel``.
- The :kbd:`Control-Space` binding can be correctly customised (:issue:`7922`).
- ``exit`` works correctly in bindings (:issue:`7967`).
- The :kbd:`F1` binding, which opens the manual page for the current command,
now works around a bug in certain ``less`` versions that fail to clear the
screen (:issue:`7863`).
- The binding for :kbd:`Alt-S` now toggles whether ``sudo`` is prepended, even
when it took the commandline from history instead of only adding it.
- The new functions ``fish_commandline_prepend`` and
``fish_commandline_append`` allow toggling the presence of a prefix/suffix on
the current commandline. (:issue:`7905`).
- ``backward-kill-path-component`` :kbd:`Control-W`) no longer erases parts of
two tokens when the cursor is positioned immediately after ``/``.
(:issue:`6258`).
Improved prompts
^^^^^^^^^^^^^^^^
- The default Vi mode prompt now uses foreground instead of background colors,
making it less obtrusive (:issue:`7880`).
- Performance of the "informative" git prompt is improved somewhat
(:issue:`7871`). This is still slower than the non-informative version by its
very nature. In particular it is IO-bound, so it will be very slow on slow
disks or network mounts.
- The sample prompts were updated. Some duplicated prompts, like the various
classic variants, or less useful ones, like the "justadollar" prompt were
removed, some prompts were cleaned up, and in some cases renamed. A new
"simple" and "disco" prompt were added (:issue:`7884`, :issue:`7897`,
:issue:`7930`). The new prompts will only take effect when selected and
existing installed prompts will remain unchanged.
- A new ``prompt_login`` helper function to describe the kind of "login" (user,
host and chroot status) for use in prompts. This replaces the old "debian
chroot" prompt and has been added to the default and terlar prompts
(:issue:`7932`).
- The Web-based configuration's prompt picker now shows and installs right
prompts (:issue:`7930`).
- The git prompt now has the same symbol order in normal and "informative"
mode, and it's customizable via ``$__fish_git_prompt_status_order``
(:issue:`7926`).
Completions
^^^^^^^^^^^
- Added completions for:
- ``firewall-cmd`` (:issue:`7900`)
- ``sv`` (:issue:`8069`)
- Improvements to plenty of completions!
- Commands that wrap ``cd`` (using ``complete --wraps cd``) get the same
completions as ``cd`` (:issue:`4693`).
- The ``--force-files`` option to ``complete`` works for bare arguments, not
just options (:issue:`7920`).
- Completion descriptions for functions don't include the function definition,
making them more concise (:issue:`7911`).
- The ``kill`` completions no longer error on MSYS2 (:issue:`8046`).
- Completion scripts are now loaded when calling a command via a relative path
(like ``./git``) (:issue:`6001`, :issue:`7992`).
- When there are multiple completion candidates, fish inserts their shared
prefix. This prefix was computed in a case-insensitive way, resulting in
wrong case in the completion pager. This was fixed by only inserting prefixes
with matching case (:issue:`7744`).
Improved terminal support
^^^^^^^^^^^^^^^^^^^^^^^^^
- fish no longer tries to detect a missing new line during startup, preventing
an erroneous ``⏎`` from appearing if the terminal is resized at the wrong
time, which can happen in tiling window managers (:issue:`7893`).
- fish behaves better when it disagrees with the terminal on the width of
characters. In particular, staircase effects with right prompts should be
gone in most cases (:issue:`8011`).
- If the prompt takes up the entire line, the last character should no longer
be chopped off in certain terminals (:issue:`8002`).
- fish's reflow handling has been disabled by default for kitty
(:issue:`7961`).
- The default prompt no longer produces errors when used with a dumb terminal
(:issue:`7904`).
- Terminal size variables are updated for window size change signal handlers
(``SIGWINCH``).
- Pasting within a multi-line command using a terminal that supports bracketed
paste works correctly, instead of producing an error (:issue:`7782`).
- ``set_color`` produces an error when used with invalid arguments, rather than
empty output which interacts badly with Cartesian product expansion.
For distributors
----------------
- fish runs correctly on platforms without the ``O_CLOEXEC`` flag for
``open(2)`` (:issue:`8023`).
|