Fish Shell 4 Is Here Entirely Rewritten in Rust

Fish Shell 4 is here, completely rewritten in Rust with improved key bindings, self-installable builds, better history control, and more.

The much-loved Fish Shell project has just unveiled Fish 4, a significant update introducing major behind-the-scenes improvements and new user-facing features.

Without further ado, here’s the star of the show – Rust! Yes, that’s right: Fish 4 has been entirely rewritten in Rust. However, from an everyday user’s perspective, the transition should remain virtually invisible: the commands, settings, and typical interactions are intended to be unchanged.

Moving on to what you will notice, Fish has introduced an updated bind notation system and deeper terminal compatibility. You can now replace opaque sequences with friendlier, intuitive commands such as bind ctrl-right. Thanks to “modifyOtherKey” and the Kitty keyboard protocol, Fish can distinguish control sequences that previously seemed identical.

Another major theme in Fish 4 is tighter integration with terminal capabilities. For example, Fish now automatically employs OSC 133 sequences for prompts and command output, promoting smoother synchronization with various terminals that once relied on add-on “shell integration” scripts.

In addition, Fish 4 standardizes cursor changes in vi-mode across most terminals, no longer relying on environment-specific detection, which often falls short.

Notably, the shell now handles long command lines more gracefully, scrolling instead of misrendering them. Plus, any edits triggered by command-line bindings are immediately visible, offering a more intuitive scripting and interactive experience.

Fish Shell 4
Fish Shell 4

Speaking of enhancements to interactive use, the ctrl-r history pager—first introduced in Fish 3.6—has been refined. You can now rely on glob syntax to filter history entries more precisely. Even better, this search applies strictly to the current command, letting you build more complex, multi-line history reconstructions without rummaging through entire scripts.

The default theme has also seen a small but meaningful tweak: commands now appear in the terminal’s “normal” color instead of the somewhat hard-to-read “blue.” Existing users will retain their current settings unless they manually reload the theme via fish_config.

The new self-installable build feature might be a game-changer for users who frequently SSH into servers without administrative privileges. After compiling Fish, you can run a single, self-contained binary that directly extracts everything necessary—functions, man pages, and even the web configuration tool—to your home directory.

In other words, this makes it easier than ever to run Fish on environments where a package manager is not available. Pre-built versions are available for major platforms like x86_64 and aarch64 Linux on the project’s GitHub Releases page. Other platforms are supported, too, though you may need to compile your own builds.

Another long-requested feature, the ability to exclude certain commands from history, is finally here. By defining a custom function called fish_should_add_to_history, you can decide exactly which commands get retained. Any command flagged for exclusion remains in a temporary spot, so you can still press the up arrow to repeat it immediately, but once you run something else, it’s erased.

For scripting enthusiasts, Fish 4 delivers several smaller—but still valuable—improvements:

  • string match now supports a --max-matches option, allowing you to limit the number of matches processed.
  • set gains a --no-event option to suppress variable change events (particularly useful in event handlers).
  • time begins measuring earlier, capturing the duration of any command substitutions that occur before executing a command.
  • complete --erase fully disables autoloading completions for specified commands, aligning with functions --erase.

For more information on all novelties in Fish Shell 4, see the release announcement.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.