Software-update: Fish 4.0.0

Fish logo

Versie 4.0.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 versie 4.0.0 is erg lang en op deze pagina te vinden; we volstaan met het weergeven van de belangrijkste veranderingen:

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

fish-shell

Versienummer 4.0.0
Releasestatus Final
Besturingssystemen Linux, BSD, macOS, Windows 10, Windows 11
Website Fish-shell
Download https://fishshell.com/
Licentietype GPL

Door Bart van Klaveren

Downloads en Best Buy Guide

02-03-2025 • 12:00

9

Bron: Fish-shell

Update-historie

21-04 fish 4.0.2 0
13-03 Fish 4.0.1 4
02-03 Fish 4.0.0 9

Reacties (9)

9
9
6
1
0
0
Wijzig sortering
De changelog voor versie 4.0.0 is erg lang en op deze pagina te vinden; we volstaan met het weergeven van de belangrijkste veranderingen:
Haha nee. De belangrijkste verandering is de volledige rewrite in Rust.
En dat zonder druk vanuit de Rust community!
Ben erg benieuwd! Gebruik Fish momenteel met Starship, en ben vrijwel overal omgegaan van ZSH.
Wat vind je het voordeel tov zsh, zoals oh my zsh?
Ik heb zsh op mijn Manjaro machine altijd gebruikt, maar heb nu een verse installatie van CachyOS en dat komt met fish, wat ik nog niet kende.
Starship is zeg maar de vervanger van omz. Het werkt ongeveer hetzelfde, maar zoals altijd is het wel even wennen.

Persoonlijk vind ik het heel fijn hoe snel je een alias aanmaakt met fish. En je hebt nog meer van die commando's, waar ik nog altijd maar moet kijken.

Voordeel is vooral dat het minder log aanvoelt. Nadeel is dat het voor power users misschien net iets te klein is? Zelf mis ik niet veel, en maak ik mijn eigen aliassen aan bijvoorbeeld.
Dit duurde mij minuten leeswerk voordat ik doorhad dat RUST iets anders was dan Rust : https://www.corrosionhour.com/how-to-fish-in-rust/
Fish also uses threads for its award-winning (note to editor: find an actual award) autosuggestions and syntax highlighting _/-\o_

Op dit item kan niet meer gereageerd worden.