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

个人介绍

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

教程

官方介绍

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/.

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

/opt/homebrew/bin/fish

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

/usr/local/bin/fish

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

❯ which fish
/opt/homebrew/bin/fish

参考

本文由 简悦 SimpRead 转码, 原文地址 gist.github.com

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

Fish 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/ package manager installed on your machine.

brew install fish

More info: 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.

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

set -x LANG en_US.UTF-8

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

fish_config