WSL: Cannot set fish as "default" shell

Your Windows build number: Microsoft Windows [Version 10.0.15063]

What you’re doing and what’s happening: Cannot set fish as default shell

I’ve tried

  • C:\Windows\System32\bash.exe ~ -c fish
  • C:\Windows\System32\bash.exe ~ -c /usr/bin/fish

When I run Ubuntu on Windows it’s just a blank screen.

What’s wrong / what should be happening instead: When starting Ubuntu on Windows the default shell right away should be fish

C:\Windows\System32\bash.exe ~ -c /usr/bin/fish works in my other pc. But I forgot at what build I installed wsl (I’m already in the fast ring).

EDIT 1 Trying to reinstall.

EDIT 2 Didn’t help

EDIT 3 Also tried adding

ssh-agent fish
exit

on top of ~/.bashrc as stated here

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 2
  • Comments: 24 (4 by maintainers)

Most upvoted comments

I tried adding

# Launch Fish
if [ -t 1 ]; then
exec fish
fi

But when I start Bash it’s just stuck in Welcome to fish, the friendly interactive shell

Same result with

if [[ -t 1 && -x /usr/bin/fish ]]; then
    exec /usr/bin/fish
fi

If you are using Windows Terminal, you can just pass fish to wsl.exe as an argument in the ‘Command Line’ option. eg. C:\WINDOWS\system32\wsl.exe -d Ubuntu-20.04 fish. It worked for me 🥳

I know this is an old thread, but for those still dealing with this (like me… even on the current Preview version of WSL), chsh (even with sudo) doesn’t work. @benhillis had mentioned /etc/passwd and editing it directly really has been the solution that works best for me (vs. launching fish or zsh or whatever from somewhere else). Just edit the /etc/passwd file and change the default shell in there for the user that wants fish (zsh, etc.) and it works perfectly.

I’m now using zsh instead of fish. And I’m using the Ubuntu from the Windows store.

chsh -s $(which zsh) worked for me out of the box.

@benhillis Uhh. So the part will respect the default shell in your /etc/passwd file. is not to be worried about, right? Just have to run chsh -c fish and that’s it?