Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My fish is blind? (fish does not recognise any commands after setting it as default shell on Mac OS Big Sur, M1 Mac)

I installed fish with homebrew on Mac OS Big Sur, Apple Silicon. Then I added /opt/homebrew/bin/fish to /etc/shells. When I now start fish from the default shell, it recognises all commands (like git flow init). After changing the default shell with chsh -s /opt/homebrew/bin/fish, suddenly it won't recognise anything anymore and always gives a Unknown command. I haven't found anything regarding this issue and uninstalled fish and brew several times...

like image 986
dusen Avatar asked Mar 20 '21 16:03

dusen


People also ask

How do I set the default shell on my fish?

Switching to fish? If you wish to use fish (or any other shell) as your default shell, you need to enter your new shell's executable /usr/local/bin/fish in two places: add /usr/local/bin/fish to /etc/shells. change your default shell with chsh -s to /usr/local/bin/fish.

What is the default Terminal in Mac?

Mac OS X Shells Mac OS X comes with the Bourne Again SHell (bash) as the default user shell and also includes the TENEX C shell (tcsh), the Korn shell (ksh), and the Z shell (zsh). bash, ksh, and zsh are compatible with sh, the original Bourne shell.


1 Answers

Here are the steps I used to setup the fish shell on my M1 MacBook Air. Per the comments on the question, the key to solving the Unknown Command issue is the fish_add_path:

$ brew install fish ​
$ fish
$ fish_add_path /opt/homebrew/bin
$ echo "/opt/homebrew/bin/fish" | sudo tee -a /etc/shells
$ chsh -s /opt/homebrew/bin/fish

like image 196
Hamill Kim Avatar answered Oct 02 '22 22:10

Hamill Kim