Using fish shell on Windows

PowerShell and cmd.exe just won’t work for me after years of Fish Shell, so lets use fish shell on Windows too:

  • Install MSYS2 from https://www.msys2.org/
  • Open the MSYS2 mintty, then run:
    • pacman -Su
    • pacman -S fish
  • Edit C:\msys64\home\<username>\.bashrc and append:
    • HOME=/c/Users/<username> fish; exit
  • Finally, configure Windows Terminal (Settings -> Open JSON file), and add the following to profiles/list:
{
  "commandline": "C:/msys64/msys2_shell.cmd -defterm -here -no-start -msys -use-full-path",
  "guid": "{71160544-14d8-4194-af25-d05feeac7233}",
  "icon": "C:/msys64/msys2.ico",
  "name": "fish",
  "startingDirectory": "%UserProfile%"
}

Set this new profile as your default in the Windows Terminal settings under Startup and you’re done.

Some Notes

The use of “-use-full-path” makes the shell inherit the entire windows $PATH so you can run anything you would have under a normal windows shell. Setting $HOME before running fish makes commands like “cd ~” use your windows home directory rather than MSYS2’s.

Go fish!