# 如何把brew安装的fish设置为默认shell

**URL:** <https://forum.beginner.center/t/topic/1913>\
**Category:** 🛠工具与编程\
**Tags:** fish\
**Created:** [2025 年4 月 23 日 09:28 UTC](https://forum.beginner.center/t/topic/1913 "2025-04-23T09:28:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

作者： ![doggie](https://forum.beginner.center/user_avatar/forum.beginner.center/doggie/32/550_2.png) [@doggie](https://forum.beginner.center/u/doggie)\
发布日期： [2025 年4 月 23 日 09:28 UTC](https://forum.beginner.center/t/topic/1913/1 "2025-04-23T09:28:59Z")

</div>

官方的设置是

```auto
 chsh -s /usr/local/bin/fish

```

但这是基于通过官方方式安装的fish，而brew安装的fish路径不在那里，会报错

```auto
chsh: WARNING: shell '/usr/local/bin/fish' does not exist

```

现在终端输入

```auto
brew info fish

```

找到fish的安装路径

比如我的是

```auto
/opt/homebrew/Cellar/fish/4.0.1

```

其下bin文件夹中的fish即我们需要的路径

```auto
/opt/homebrew/Cellar/fish/4.0.1/bin/fish

```

这下就可以了

```auto
chsh -s /opt/homebrew/Cellar/fish/4.0.1/bin/fis
h

```
