After a system updated my fish shell prompt is no longer working. Whenever I open a terminal I get this error:
/usr/share/fish/vendor_conf.d/snapd.fish (line 3): fish_add_path -aP $snap_bin_path ^ from sourcing file /usr/share/fish/vendor_conf.d/snapd.fish called on line 294 of file /usr/share/fish/config.fish from sourcing file /usr/share/fish/config.fish called during startup Welcome to fish, the friendly interactive shell Type `help` for instructions on how to use fish I have confirmed that fish_add_path is cannot be invoked from the command line, which surprises me because it's one of the essential helper functions included in fish.
Other relevant details:
~> snap --version snap 2.54.2+20.04ubuntu2 snapd 2.54.2+20.04ubuntu2 series 16 ubuntu 20.04 kernel 5.13.0-28-generic ~> fish --version fish, version 3.1.0 ~> which fish /usr/bin/fish ~> echo $PATH /home/user/.amplify/bin /home/user/.local/bin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/games /usr/local/games /snap/bin /home/user/.local/bin ...so /snap/bin is on the $PATH anyway.
I'm assuming an update to fish and/or snap triggered this error. Assuming a clean installation of fish on Ubuntu, where should I find the fish_add_path tool?
31 Answer
You might be thinking of set -U fish_user_paths from earlier versions of fish. fish_add_path was added in fish 3.2.0 but you are running fish 3.1.0.
You can upgrade to the latest version of fish (3.3.1) from a PPA as follows:
sudo apt-add-repository ppa:fish-shell/release-3 sudo apt update sudo apt upgrade This is the PPA linked to from the official fish homepage. Based on the information on the 3.x release series page, this should work for the bionic, focal, groovy, hirsute, and xenial versions of Ubuntu.
Running these commands resolved this issue the next time I opened a fish shell.
Alternatively, you can comment out the relevant line in /usr/share/fish/vendor_conf.d/snapd.fish. It appears that snap assumes you are running a newer version of fish.