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...
Asked
Active
Viewed 1.8k times
53

dusen
- 531
- 1
- 4
- 3
-
2Is PATH set? .. – Arkadiusz Drabczyk Mar 20 '21 at 17:01
-
17Thanks for the hint! Had to add `fish_add_path /opt/homebrew/bin` to config.fish – dusen Mar 20 '21 at 19:13
-
@dusen Your comment has also helped me (and possibly others). Would you mind posting it as the accepted answer? – Torbilicious Nov 17 '21 at 14:53
-
1Clever title :) It would be good to accept the answer, it works – lewis Jan 24 '22 at 09:24
1 Answers
104
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

Hyomin Kim
- 1,151
- 1
- 7
- 7
-
1Typo in the shell path. Should say `echo "/opt/homebrew/bin/fish"` on line 4 – Syntax Dec 23 '21 at 20:31
-
@Syntax Oh, yes, you are right. Thank you for your pointing out! I edited. – Hyomin Kim Dec 25 '21 at 12:02