Become a member

Get the best offers and updates relating to Liberty Case News.

― Advertisement ―

spot_img

Album Analysis: Why Lady Gaga’s ‘Mayhem’ Sounds Both Old and New – FAIL Blog

via @shookavenueThe Sounds of MayhemSonically, Mayhem primarily explores industrial music and electropop. On the surface, this seems like territory the Grammy-winning superstar has walked...
HomeStartupsRelease fish 4.0.0 (released February 27, 2025) · fish-shell/fish-shell · GitHub

Release fish 4.0.0 (released February 27, 2025) · fish-shell/fish-shell · GitHub

fish’s core code has been ported from C++ to Rust (#9512). This means a large change in dependencies and how to build fish. However, there should be no direct impact on users. Packagers should see the For Distributors section at the end.

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 a bind 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 as cancel-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 adding no-qmark-noglob to fish_features and restarting fish:

    set -Ua fish_features no-qmark-noglob
    

    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 by wsl.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 into SIGTTOU remain in a suspended state indefinitely (#5263). The workaround is to explicitly disown processes you wish to outlive the shell session.

Notable improvements and fixes

  • 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 example

    • 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.

    Any key argument that starts with an ASCII control character (like \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 with fish --install=PATH To uninstall, remove the fish binaries and that directory.

    This build system is experimental; the main build system, using cmake, 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 is git (#9411).

Deprecations and removed features

  • commandline --tokenize (short option -o) has been deprecated in favor of commandline --tokens-expanded (short option -x) which expands variables and other shell syntax, removing the need to use eval in completion scripts (#10212).

  • Two new feature flags:

    • remove-percent-self (see status features) disables PID expansion of %self, which has been supplanted by $fish_pid (#10262).
    • test-require-arg disables test’s one-argument mode. That means test -n without an additional argument will return false, test -z will keep returning true. Any other option without an argument, anything that is not an option and no argument will be an error. This also goes for [, test’s alternate name.
      This is a frequent source of confusion and so we are breaking with POSIX explicitly in this regard.
      In addition to the feature flag, there is a debug category “deprecated-test”. Running fish with fish -d deprecated-test will show warnings whenever a test invocation that would change is used. (#10365).

    These can be enabled with:

    set -Ua fish_features remove-percent-self test-require-arg
    

    We intend to enable them by default in future, and after that eventually make them read-only.

  • Specifying key names as terminfo names (using the bind -k syntax) is deprecated and may be removed in a future version.

  • When a terminal pastes text into fish using bracketed paste, fish used to switch to a special paste bind mode.
    This bind mode has been removed. The behavior on paste is no longer configurable.

  • When an interactive fish is stopped or terminated by a signal that cannot be caught (SIGSTOP or SIGKILL), it may leave the terminal in a state where keypresses with modifiers are sent as CSI u sequences, instead of traditional control characters or escape sequences that are recognized by Readline and compatible programs, such as bash and python.
    If this happens, you can use the reset command from ncurses to restore the terminal state.

  • fish_key_reader --verbose no longer shows timing information.

  • Terminal information is no longer read from hashed terminfo databases, or termcap databases (#10269). The vast majority of systems use a non-hashed terminfo database, which is still supported.

  • source returns an error if used without a filename or pipe/redirection (#10774).

Scripting improvements

  • for loops will no longer remember local variables from the previous iteration (#10525).
  • A new history append subcommand appends a command to the history, without executing it (#4506).
  • A new redirection: /path/to/file will try opening the file as input, and if it doesn’t succeed silently uses /dev/null instead.
    This can help with checks like test -f /path/to/file; and string replace foo bar < /path/to/file. (#10387)
  • A new option commandline --tokens-raw prints a list of tokens without any unescaping (#10212).
  • A new option commandline --showing-suggestion tests whether an autosuggestion is currently displayed (#10586).
  • functions and type now show that a function was copied and its source, rather than solely Defined interactively (#6575).
  • Stack trace now shows line numbers for copied functions (#6575).
  • foo & && bar is now a syntax error, like in other shells (#9911).
  • if -e foo; end now prints a more accurate error (#10000).
  • cd into a directory that is not readable but accessible (permissions --x) is now possible (#10432).
  • An integer overflow in string repeat leading to a near-infinite loop has been fixed (#9899).
  • string shorten behaves better in the presence of non-printable characters, including fixing an integer overflow that shortened strings more than intended (#9854).
  • string pad no longer allows non-printable characters as padding (#9854).
  • string repeat now allows omission of -n when the first argument is an integer (#10282).
  • string match and replace have a new --max-matches option to return as soon as the specified number of matches have been identified, which can improve performance in scripts (#10587).
  • functions --handlers-type caller-exit once again lists functions defined as function --on-job-exit caller, rather than them being listed by functions --handlers-type process-exit.
  • A new set --no-event option sets or erases variables without triggering a variable event. This can be useful to change a variable in an event handler (#10480).
  • Commas in command substitution output are no longer used as separators in brace expansion, preventing a surprising expansion in some cases (#5048).
  • Universal variables can now store strings containing invalid UTF-8 (#10313).
  • A new path basename -E option that causes it to return the basename (“filename” with the directory prefix removed) with the final extension (if any) also removed. This is a shorter version of path change-extension "" (path basename $foo) (#10521).
  • A new math --scale-mode option to select truncate, round, floor, ceiling as you wish; the default value is truncate. (#9117).
  • random is now less strict about its arguments, allowing a start larger or equal to the end. (#10879)
  • function --argument-names now produces an error if a read-only variable name is used, rather than simply ignoring it (#10842).
  • Tilde expansion in braces (that is, {~,}) works correctly (#10610).

Interactive improvements

  • Autosuggestions were sometimes not shown after recalling a line from history, which has been fixed (#10287).
  • Up-arrow search matches — which are highlighted in reverse colors — are no longer syntax-highlighted, to fix bad contrast with the search match highlighting.
  • Command abbreviations (those with --position command or without a --position) now also expand after decorators like command (#10396).
  • Abbreviations now expand after process separators like ; and |. This fixes a regression in version 3.6 (#9730).
  • When exporting interactively defined functions (using type, functions or funcsave) the function body is now indented, to match the interactive command line editor (#8603).
  • ctrl-x (fish_clipboard_copy) on multiline commands now includes indentation (#10437).
  • ctrl-v (fish_clipboard_paste) now strips ASCII control characters from the pasted text.
    This is consistent with normal keyboard input (#5274).
  • When a command like fg %2 fails to find the given job, it no longer behaves as if no job spec was given (#9835).
  • Redirection in command position like >echo is now highlighted as error (#8877).
  • fish_vi_cursor now works properly inside the prompt created by builtin read (#10088).
  • fish no longer fails to open a FIFO if interrupted by a terminal resize signal (#10250).
  • read --help and friends no longer ignore redirections. This fixes a regression in version 3.1 (#10274).
  • Measuring a command with time now considers the time taken for command substitution (#9100).
  • fish_add_path now automatically enables verbose mode when used interactively (in the command line), in an effort to be clearer about what it does (#10532).
  • fish no longer adopts TTY modes of failed commands (#10603).
  • complete -e cmd now prevents autoloading completions for cmd (#6716).
  • fish’s default color scheme no longer uses the color “blue”, as it has bad contrast against the background in a few terminal’s default palettes (#10758, #10786)
    The color scheme will not be upgraded for existing installs. If you want, you should select it again via fish_config.
  • Command lines which are larger than the terminal are now displayed correctly, instead of multiple blank lines being displayed (#7296).
  • Prompts that use external commands will no longer produce an infinite loop if the command crashes (#9796).
  • Undo (ctrl-z) restores the cursor position too (#10838).
  • The output of jobs shows “-” for jobs that have the same process group ID as the fish process, rather than “-2” (#10833).
  • Job expansion (%1 syntax) works properly for jobs that are a mixture of external commands and functions (#10832).
  • Command lines which have more lines than the terminal can be displayed and edited correctly (#10827).
  • Functions that have been erased are no longer highlighted as valid commands (#10866).
  • not, time, and variable assignments (that is not time a=b env) is correctly recognized as valid syntax (#10890).
  • The Web-based configuration removes old right-hand-side prompts again, fixing a regression in fish 3.4.0 (#10675).
  • Further protection against programs which crash and leave the terminal in an inconsistent state (#10834, #11038).
  • A workaround for git being very slow on macOS has been applied, improving performance after a fresh boot (#10535).

New or improved bindings

  • When the cursor is on a command that resolves to an executable script, alt-o will now open that script in your editor (#10266).
  • During up-arrow history search, shift-delete will delete the current search item and move to the next older item. Previously this was only supported in the history pager.
  • shift-delete will also remove the currently-displayed autosuggestion from history, and remove it as a suggestion.
  • ctrl-Z (also known as ctrl-shift-z) is now bound to redo.
  • Some improvements to the alt-e binding which edits the command line in an external editor:
    • The editor’s cursor position is copied back to fish. This is currently supported for Vim and Kakoune.
    • Cursor position synchronization is only supported for a set of known editors, which are now also detected in aliases which use complete --wraps. For example, use complete --wraps my-vim vim to synchronize cursors when EDITOR=my-vim.
    • Multiline commands are indented before being sent to the editor, which matches how they are displayed in fish.
  • The ...-path-component bindings, like backward-kill-path-component, now treat # as part of a path component (#10271).
  • Bindings like alt-l that print output in between prompts now work correctly with multiline commandlines.
  • alt-d on an empty command line lists the directory history again. This restores the behavior of version 2.1.
  • history-prefix-search-backward and -forward now maintain the cursor position, instead of moving the cursor to the end of the command line (#10430).
  • The following keys have refined behavior if the terminal supports the new keyboard encodings:
    • shift-enter now inserts a newline instead of executing the command line.
    • ctrl-backspace now deletes the last word instead of only one character (#10741).
    • ctrl-delete deletes the next word (same as alt-d).
  • New special input functions:
    • forward-char-passive and backward-char-passive are like their non-passive variants but do not accept autosuggestions or move focus in the completion pager (#10398).
    • forward-token, backward-token, kill-token, and backward-kill-token are similar to the *-bigword variants but for the whole argument token (which includes escaped spaces) (#2014).
    • clear-commandline, which merely clears the command line, as an alternative to cancel-commandline which prints ^C and a new prompt (#10213).
  • The accept-autosuggestion special input function now returns false when there was nothing to accept (#10608).
  • Vi mode has seen some improvements but continues to suffer from the lack of people working on it.
    • New default cursor shapes for insert and replace mode.
    • ctrl-n in insert mode accepts autosuggestions (#10339).
    • Outside insert mode, the cursor will no longer be placed beyond the last character on the commandline.
    • When the cursor is at the end of the commandline, a single l will accept an autosuggestion (#10286).
    • The cursor position after pasting (p) has been corrected.
    • Added an additional binding, _, for moving to the beginning of the line (#10720).
    • When the cursor is at the start of a line, escaping from insert mode no longer moves the cursor to the previous line.
    • Added bindings for clipboard interaction, like ",+,p and ",+,y,y.
    • Deleting in visual mode now moves the cursor back, matching vi (#10394).
    • The ;, ,, v, V, I, and gU bindings work in visual mode (#10601, #10648).
    • Support % motion (#10593).
    • ctrl-k to remove the contents of the line beyond the cursor in all modes (#10648).
    • Support ab and ib vi text objects. New input functions are introduced jump-{to,till}-matching-bracket (#1842).
    • The E binding now correctly handles the last character of the word, by jumping to the next word (#9700).

Completions

  • Command-specific tab completions may now offer results whose first character is a period. For example, it is now possible to tab-complete git add for files with leading periods. The default file completions hide these files, unless the token itself has a leading period (#3707).
  • Option completion now uses fuzzy subsequence filtering, just like non-option completion (#830).
    This means that --fb may be completed to --foobar if there is no better match.
  • Completions that insert an entire token now use quotes instead of backslashes to escape special characters (#5433).
  • Normally, file name completions start after the last : or = in a token.
    This helps commands like rsync --files-from=.
    This special meaning can now disabled by escaping these separators as \: and \=.
    This matches Bash’s behavior.
    Note that this escaping is usually not necessary since the completion engine already tries
    to guess whether the separator is actually part of a file name.
  • Various new completion scripts and numerous updates to existing ones.
  • Completions could hang if the PAGER environment variable was sent to certain editors on macOS, FreeBSD and some other platforms. This has been fixed (#10820).
  • Generated completions are now stored in $XDG_CACHE_HOME/fish or ~/.cache/fish by default (#10369)
  • A regression in fish 3.1, where completing a command line could change it completely, has been fixed (#10904).

Improved terminal support

  • fish now marks the prompt and command-output regions (via OSC 133) to enable terminal shell integration (#10352).
    Shell integration shortcuts can scroll to the next/previous prompt or show the last command output in a pager.
  • fish now reports the working directory (via OSC 7) unconditionally instead of only for some terminals (#9955).
  • fish now sets the terminal window title (via OSC 0) unconditionally instead of only for some terminals (#10037).
  • Focus reporting in tmux is no longer disabled on the first prompt.
  • Focus reporting is now disabled during commands run inside key bindings (#6942).
  • Cursor changes are applied to all terminals that support them, and the list of specifically-supported terminals has been removed (#10693).
  • If it cannot find the terminfo entry given by TERM environment variable, fish will now use an included xterm-256color definition to match the vast majority of current terminal emulators (#10905). If you need to have a specific terminfo profile for your terminal’s TERM variable, install it into the terminfo database.
  • Further improvements to the correct display of prompts which fill the width of the terminal (#8164).

Other improvements

  • status gained a buildinfo subcommand, to print information on how fish was built, to help with debugging (#10896).
  • fish_indent will now collapse multiple empty lines into one (#10325).
  • fish_indent now preserves the modification time of files if there were no changes (#10624).
  • Performance in launching external processes has been improved for many cases (#10869).
  • Performance and interactivity under Windows Subsystem for Linux has been improved, with a workaround for Windows-specific locations being appended to $PATH by default (#10506).
  • On macOS, paths from /etc/paths and /etc/manpaths containing colons are handled correctly (#10684).
  • Additional filesystems such as AFS are properly detected as remote, which avoids certain hangs due to expensive filesystem locks (#10818).
  • A spurious error when launching multiple instances of fish for the first time has been removed (#10813).

For distributors

fish has been ported to Rust. This means a significant change in dependencies, which are listed in the README. In short, Rust 1.70 or greater is required, and a C++ compiler is no longer needed (although a C compiler is still required, for some C glue code and the tests).

CMake remains the recommended build system, because of cargo’s limited support for installing support files. Version 3.5 remains the minimum supported version. The Xcode generator for CMake is not supported any longer (#9924). CMake builds default to optimized release builds (#10799).

fish no longer depends on the ncurses library, but still uses a terminfo database. When packaging fish, please add a dependency on the package containing your terminfo database instead of curses.

The test target was removed as it can no longer be defined in new CMake versions. Use make fish_run_tests. Any existing test target will not print output if it fails (#11116).

The Web-based configuration has been rewritten to use Alpine.js (#9554).

Changes since fish 4.0b1

A number of improvements were included in fish 4.0.0 following the beta release of 4.0b1. These include fixes for regressions, improvements to completions and documentation, and the removal of a small number of problematic changes.

The full list of fixed issues can be found on the GitHub milestone page for 4.0-final.

Download links: To download the source code for fish, use the file named “fish-4.0.0.tar.xz”. The file downloaded from “Source code (tar.gz)” may not build correctly. The SHA-256 sum of this file is 2fda5bd970357064d8d4c896e08285ba59965ca2a8c4829ca8a82bf3b89c69f3. A GPG signature from David Adam (key ID 0x7A67D962D88A709A) is available is available as “fish-4.0.0.tar.xz.asc”.

Source link