# 【工具推荐】——fish-shell，一款macOS好用的shell工具

**URL:** <https://forum.beginner.center/t/topic/780>\
**Category:** 🛠工具与编程\
**Tags:** github, shell, macos\
**Created:** [2024 年1 月 30 日 12:30 UTC](https://forum.beginner.center/t/topic/780 "2024-01-30T12:30:38Z")\
**Posts on this page:** 2\
**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)\
发布日期： [2024 年1 月 30 日 12:30 UTC](https://forum.beginner.center/t/topic/780/1 "2024-01-30T12:30:38Z")

</div>

> **[GitHub - fish-shell/fish-shell: The user-friendly command line shell.](https://github.com/fish-shell/fish-shell)**
>
> The user-friendly command line shell.

# 个人介绍

可以让你的shell变得更好看更方便

# 教程

- [【转载】fish-shell教程](https://forum.beginner.center/t/topic/1857)

# 官方介绍

fish is a smart and user-friendly command line shell for macOS, Linux, and the rest of the family. fish includes features like syntax highlighting, autosuggest-as-you-type, and fancy tab completions that just work, with no configuration required.

For downloads, screenshots and more, go to [https://fishshell.com/](https://fishshell.com/).

---

<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 年3 月 27 日 12:48 UTC](https://forum.beginner.center/t/topic/780/2 "2025-03-27T12:48:18Z")

</div>

注意通过brew安装的话，fish的路径在

```auto
/opt/homebrew/bin/fish

```

而官方方式安装的话路径在

```auto
/usr/local/bin/fish

```

你可以在其他shell里通过这个命令查看自己电脑的fish所在的路径（比如下面是我在zsh里

```auto
❯ which fish
/opt/homebrew/bin/fish

```

# 参考

> 本文由 [简悦 SimpRead](http://ksria.com/simpread/) 转码， 原文地址 [gist.github.com](https://gist.github.com/gagarine/cf3f65f9be6aa0e105b184376f765262)

> Install fish shell on macOS Mojave with brew. GitHub Gist: instantly share code, notes, and snippets…

[Fish](http://fishshell.com/) is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the [https://brew.sh/](https://brew.sh/) package manager installed on your machine.

`brew install fish`

More info: [https://fishshell.com/docs/current/tutorial.html#tut\_path](https://fishshell.com/docs/current/tutorial.html#tut_path)

Check the fish path with `which fish` . In the examples below it was located at: `/opt/homebrew/bin/fish` On older Macs default path is `/usr/local/bin/fish`, replace accordingly in the instruction below.

## Make `fish` the default shell

MacOS allow you to change your default Shell using comande line or GUI methodes [https://support.apple.com/en-us/102360](https://support.apple.com/en-us/102360).

**Using the terminal:**

1. check the fish path with `which fish`. In the examples below it was located at: `/opt/homebrew/bin/fish`. On older Macs the path might differ.
2. `chsh -s /opt/homebrew/bin/fish`

## Add brew binaries in fish path

run the command: `fish_add_path /opt/homebrew/bin`

To collect command completions for all commands run:

`fish_update_completions`

I edited the ~/.config/fish/config.fish to have my terminal in english

```auto
set -x LANG en_US.UTF-8

```

You can configure your shell by launching the web interface, run:

`fish_config`

- [https://fishshell.com/docs/current/cmds/fish\_add\_path.html](https://fishshell.com/docs/current/cmds/fish_add_path.html)
- [https://linux.die.net/man/1/chsh](https://linux.die.net/man/1/chsh)
