官方的设置是
chsh -s /usr/local/bin/fish
但这是基于通过官方方式安装的fish,而brew安装的fish路径不在那里,会报错
chsh: WARNING: shell '/usr/local/bin/fish' does not exist
现在终端输入
brew info fish
找到fish的安装路径
比如我的是
/opt/homebrew/Cellar/fish/4.0.1
其下bin文件夹中的fish即我们需要的路径
/opt/homebrew/Cellar/fish/4.0.1/bin/fish
这下就可以了
chsh -s /opt/homebrew/Cellar/fish/4.0.1/bin/fis
h