On Ubuntu 18.04 I've changed my shell to fish via
chsh -s `which fish`
I've installed Maillspring and Visual Studio Code snap apps, they installed fine and could be launched from the dash initially, but after logging in and logging back out none of them showed up in the dash anymore.
Searching for them in software store shows that are installed and I can launch them from there.
Why will the default shell matter for this?
The command you had originally in your question
chsh -s which bash
was as you say a typo which caused a great deal of confusion around your question. Even if it had been properly formed with the ` symbols around which bash as shown below.it would change the shell to
bash
(the default). To change the shell tofish
useor simply use the command
chsh
and enter the path to the shell you want to use. See below:For more information on the fish shell see this.
EDIT: Regarding snap packages: Will the default shell matter? the answer is possibly, as it depends on the assumptions made by and the approach taken by the programmer. Refer to the differences in how bash and how fish handle things in the previous link. For example fish has no implicit subshell which can cause surprising side effects in variable assignment for the programmer that is expecting behavior similar to bash. There's a good example of an expectation of an implicit subshell in the question here.
Why? In an attempt to clarify it appears that the concept of inheritance is handled differently between fish and other more common shells like bash. My understanding is that this can result in unexpected behavior from pipes, loops, and functions (All of which are commonly used programming strategies).
The programmer may also be relying on shell builtins which either may not exist in fish or may be implemented in an unexpected fashion.
Sources:
man chsh
fish
on Wikipediasubshells on Unix & Linux
Related post on SuperUser.com
It seems that Ubuntu calls snap apps using the default shell, and it seems to assume that the shell is bash (or compatible with bash, like zsh).
I had the same problem (on Ubuntu 18.10): after
chsh -s `which fish`
, Gnome Shell was not finding snap apps anymore, even after adding/snap/bin
to the$PATH
.I solved it by letting the default shell to Bash, and instead changing the invoked by my terminal application (since I mostly use my shell through my terminal emulator anyway):
fish
.After that, starting Gnome-Terminal (either from Gnome Shell or with Ctrl+Alt+T) will launch the Fish shell, but the system shell will still be Bash so nothing breaks.
However this means that other applications spawning a user-facing shell (Visual Studio Code for instance) may require customization as well to use Fish instead of Bash.
There is a TL;DR at the bottom.
For gnome-shell to be able to start Snaps it needs two things (values in brackets are on my Fedora 29 desktop which has the same problem):
/var/lib/snapd/snap/bin
)/var/lib/snapd/desktop
)These variables are configured in
/etc/profile.d/snapd.sh
via/etc/profile
conventional bash start-up.When you switch to fish to whole
/etc/profile
start-up is skipped.Since most distros assume the usage of bash and install configuration scripts into
/etc/profile.d
, simplychsh -s /bin/fish
will not use them. Snaps not being found by gnome-shell is one such symptom.The best solution I have so far is to use fish only an interactive shell and leave bash in place to do the other housekeeping.
TL;DR
Leave the user default shell as bash:
Within
~/.bashrc
have the following:For the
bash --login
case (as invoked via X11/Wayland) remove~/.profile
and add.bash_profile
(make it bash specific):add this to your
~/.config/fish/config.fish
fileinstall bass using fisher:
or install bass using omf:
reload your session, and all should be working now :)
The snaps that you have installed, can be found in /snap/bin/ You need to have that directory in your $PATH.
Ubuntu automatically adds /snap/bin to your $PATH. It happens in /etc/profile.d/apps-bin-path.sh which runs when you get a login shell.
I checked, and
fish
also adds/snap/bin
into $PATH so normally it should be fine.Can you show us the output of the command
If the output has
/snap/bin
, then congratulations you have found a bug in Ubuntu and you can file a report on Launchpad for it.addition: Ubuntu internally probably uses $SHELL for some of the scripting. The
fish
shell is not 100% compatible withbash
and it looks like this is the cause of the problem. It is a common issue when you change your login shell to something other thanbash
. See, for example, this report https://youtrack.jetbrains.com/issue/CPP-2919 with users changing their shell to/bin/tcsh
.You need to file a bug report to Ubuntu so that someone investigates and fixes the internal scripting to work with
fish
. If you really lovefish
, that's what you need to do. ;-)