Fish Shell 4.0 Released with Rust Port & New bind key notation

Last updated: February 28, 2025 — Leave a comment

Fish shell, the popular free open-source command line shell, release new major 4.0 version yesterday.

Shell is a program that interprets and executes the commands you type in the terminal. Linux has different type shells, e.g., Bourne Shell (sh), GNU Bourne-Again Shell (bash), and C Shell (csh). And, current Ubuntu releases default to bash shell.

Fish, friendly interactive shell, is a feature-rich shell with a focus on interactivity and usability.

The new fish 4.0 release ported the core code from C++ to Rust. For those who want to build it from source, then here are large change in dependencies and and how to build process. But for end users, there should be no direct impact.

Besides switching to Rust programming language, the release also add new bind key notation. It improved keyboard handling using the CSI u protocol with fixes/extensions from the kitty keyboard protocol, thus it supports binding more keys, especially ones with ctrl/alt/shift modifiers.

The bind now supports a human-readable syntax in addition to byte sequences, including modifier names, and key names like enter and backspace. For example, bind up 'do something' binds the up-arrow key, and bind ctrl-x,alt-c 'do something' binds a sequence of two keys.

bind support human readable syntax

There are as well tons of other changes in the new release, including new function fish_should_add_to_history to decide whether a command should be added to the history, qmark-noglob feature enabled by default, and much more! See this page for details.

How to Install Fish 4.0

Fish provides pre-build packages available to download in its website:

For Ubuntu and Linux Mint, there’s an official PPA contains deb package for Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04, and Ubuntu 24.10 running on amd64 (INTEL/AMD) platform.

Just open terminal (Ctrl+Alt+T) and run commands below one by one to add PPA and install fish 4.0:

sudo add-apt-repository ppa:fish-shell/release-4
sudo apt update
sudo apt install fish

After that, run fish command in terminal to start using the shell.

Set fish as default shell (NOT Recommended)

NOTE: Change default shell in Ubuntu may break things! You must know what you’re going to do.

Ubuntu defaults to bash shell, and it may contain some system configurations as bash scripts. So changing the default shell may break things.

However, if you insist to set fish as default, simply run command:

sudo chsh -s /usr/bin/fish $USER

This command will set fish for default shell for current user only, and apply change at next login.

To revert back to bash shell, run command:

sudo chsh -s /bin/bash $USER

For more about fish, see the official documents.

Uninstall Fish:

To uninstall fish in Ubuntu, simply open terminal (Ctrl+Alt+T) and run command:

sudo apt remove --autoremove fish

Then, remove the PPA repository by running command:

sudo add-apt-repository ppa:fish-shell/release-4

For Linux Mint you also need to run sudo apt update to apply change, unless adding/removing PPA via Software Sources utility.

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via ubuntuhandbook1@gmail.com Buy me a coffee: https://ko-fi.com/ubuntuhandbook1 |

No Comments

Be the first to start the conversation.

Leave a Reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

*