Score:25

Where should I find the fish_add_path command?

us flag

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?

hr flag
The page you linked is for fish 3.3.1 - according to the [release notes](https://fishshell.com/docs/current/relnotes.html), `fish_add_path` was added in fish 3.2.0 ... you appear to be using fish 3.1.0
eg flag
FWIW, I'm having the same issue. Fish installed thru `apt`, running 3.1.0. Commenting out the line in `/usr/share/fish/vendor_conf.d/snapd.fish` does hide the error
lofidevops avatar
us flag
I'm guessing a snap update assumes a newer version of fish than available in LTS
Score:21
in flag

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.

Bastian avatar
mr flag
I can confirm that this fixed the issue for me
in flag
This fixed the issue for me too. Before upgrading, I had the 3.1.0 version of fish that came with the default Ubuntu 20.04 repo. After upgrading, I had fish 3.3.1 and `fish_add_path` is available on my PATH, which fixes the issue.
ru flag
Also, remember that there's another bug affecting that file: https://bugs.launchpad.net/snapd/+bug/1957155; if you don't fix it, you get all kind of malfunctioning in GUI applications (meld crashes with SIGTRAP, Kompare doesn't start, stuff like that).
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.