---
title: "Install Fish as Your Default Shell on macOS"
date: 2022-10-24T23:56:03.000Z
author: Z.SHINCHVEN
tags: [Shell, macOS, fish shell, starship]
canonical: https://atlassc.net/2022/10/25/fish-on-macos
---
[![fish](https://fishshell.com/assets/img/Terminal_Logo2_CRT_Flat.png)](https://fishshell.com)

[fish](https://fishshell.com/) is a smart and user-friendly command line shell for macOS, Linux, and the rest of the family. It offers features like syntax highlighting, autosuggestions, and tab completions that are designed to make using the command line a more pleasant experience.

I just switched from zsh to fish, and I'm loving it. Lots of features on zsh that requires plugins are already built-in on fish. It's also very easy to install and configure.

Here's how I installed fish on my Mac as my default shell.

## Install from HomeBrew

If you are a shell user, you probably already have HomeBrew installed. If not, you can install it from [here](https://brew.sh/).

Now, let's install fish:

```bash
brew install fish
```

## Add Fish to the List of Shells

You must add fish to the list of shells before you can use it as your default shell.

Edit: `/etc/shells` with admin privilege and add the following line:

```diff
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/dash
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
+ /opt/homebrew/bin/fish
```
`/opt/homebrew/bin/fish` is the default installation path for `fish` from HomeBrew. If you installed `fish` from somewhere else, you should use the correct path.

## Set Fish as Your Default Shell

Now, you can set fish as your default shell:

```bash
chsh -s /opt/homebrew/bin/fish
```

## Starship Prompt and $PATH in Fish

![starship](https://raw.githubusercontent.com/starship/starship/master/media/demo.gif)

[Starship](https://starship.rs/guide/) is my favorite prompt, and it is compatible with fish. You can install it with HomeBrew:

```bash
brew install starship
```

Then, add the following line to your `~/.config/fish/config.fish`:

```diff
# Add HomeBrew's bin directory to path so you can use HomeBrew's binaries like `starship`
# Fish uses `fish_add_path` instead of `export PATH` modify $PATH.
+ fish_add_path "/opt/homebrew/bin/"

# Enable Starship prompt
+ starship init fish | source

if status is-interactive
    # Commands to run in interactive sessions can go here
end
```

## Success!

Now, you can open a new terminal and enjoy the fish shell!

![fish](https://blogimgs.atlassc.net/images/fish-on-macos.jpg)
