Trouble trying to switch the default shell to fish

I’ve cross-checked if the fish executable is indeed at the location listed by chshs -l:

chsh -l
/bin/sh
/bin/bash
/usr/bin/git-shell
/usr/bin/fish
/bin/fish

Then I’ve tried both (for some reason fish executable is at both the places, I’ve installed it from official repo - community)

chsh -s /usr/bin/fish

and

chsh -s /bin/fish

both return with either

Shell changed.

or

chsh: Shell not changed.

(depending on whether running it the first time or subsequent)

I tried restarting/re-logging in, re-installing fish, but no matter what I do, konsole simply opens bash by default.

Searched some forums and they’ve asked to verify if fish is set to my user in the passwd file and it indeed seems like it:

grep [user] /etc/passwd
[user]: x :1000:1000:[Name]:/home/[user]:/bin/fish

So I have no idea how to rectify this issue… Any suggestions would be greatly appreciated!

Can you open konsole and check a couple of things?

Do these commands return what you expect?

echo $USER
echo $SHELL

Namely, is $USER set to the same user as the passwd file and is $SHELL set to bash or fish?

Yes, $USER returns the the same [user] as above and $SHELL returns the following:

echo $SHELL
/usr/bin/fish

So…why do you think you are in bash and not fish?

Because it seems to be running on bash… I’m genuinely confused, please check the screenshot:

exp

That looks like fish launched bash.

My best guess is either there is something odd in whatever you are using to launch konsole or you have something in the fish startup that is launching bash.

2 Likes

How do I rectify the same? It’s a fresh install of the OS and I’ve tried reinstalling fish multiple times. I’m able to launch it using the bash shell and it works as expected in that manner

Check your konsole settings and see what its run settings are, and try a different terminal emulator to see if it’s limited to konsole.

Then, provide more details about how you installed fish in the first place, what changes you have made (e.g. did you import any configuration files?), and what else you have tried.

2 Likes

just idea and no wish to offend . Set fish as interactive shell only until happy with use it …

" https://wiki.archlinux.org/index.php/Fish#Setting_fish_as_interactive_shell_only " :blush:

1 Like

The konsole profile was set to launch with command /bin/bash. I’ve changed it to /bin/fish and it works as intended.

Thank you all for the help! :slight_smile:

2 Likes

It might be a good idea to leave your user’s shell as bash (with chsh) and just have /bin/fish launched by Konsole. You’re presumably going to use Konsole for 99% of your terminal work, so it shouldn’t make a big difference in the quality of life.

However, when you drop to TTY to do some maintenance, or if something broke, fish’s non-compliance with POSIX might give you a hard time (I haven’t tried fish so I can’t know for sure). In any case, if you’re asking for help, people are going to give you bash commands, and you don’t want to be wrestling with some slippery fish when you’re in a situation like that.

2 Likes

zsh could be a happy medium perhaps? It’s quite “friendly” like fish, but pretty much posix-compliant and the commands are the same as bash as far as I have found so far. I did use fish for a while but had to drop into bash quite often. With zsh that hasn’t been an issue and if people do give me bash commands they have been compatible.

It doesn’t matter, really. You can use whatever shell you want for your interactive sessions in your favourite terminal emulator. You can use different terminal emulators each with a different shell. Just configure the shell in your terminal emulator settings.

The point is that it does not have to be your user’s shell as specified by the chsh command, so that when you drop to a TTY, it’s always Bash, which is the standard, default shell on any Arch-based distro, so nothing unexpected can happen.

That’s how I do it, I have Bash set as my user’s shell (if you were to look at my /etc/passwd file, you’d see /bin/bash next to my username), but I configured Konsole, my preferred terminal emulator, to launch Zsh, my preferred shell. I live in Zsh 99.9% of the time. I never use the TTY unless my DE is broken for some reason.

In fact, the only time I actually use Bash in an interactive session is through SSH, and that is also how I prefer it.

5 Likes