# Adding an Octopus to the Zsh Prompt

#### Transition from bash to zsh with custom settings, conditional emojis, and git prompt

Photo by [Serena Repice Lentini](https://unsplash.com/@serenarepice?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/octopus?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)

For my last Mac, I had a friendly [hamster face emoji in my terminal bash prompt](https://medium.com/@joycelin.codes/adding-a-hamster-face-to-the-bash-prompt-547a2edad567). After I recently upgraded to a new Mac, I discovered Apple has replaced bash with zsh as the default shell, beginning with macOS Catalina.

> [Starting with macOS Catalina, your Mac uses zsh as the default login shell and interactive shell.](https://support.apple.com/en-us/HT208050)

You can still switch back to bash, for now, but the trend is moving to zsh as the command-line interpreter for the login shell and interactive shell.

Here’s how you can add an Octopus emoji and other custom items to your zsh prompt to make life in your terminal more hospitable.

### Change your default shell

If you aren’t already using [zsh](https://www.zsh.org/) in your terminal, change the shell by updating the shell path to `/bin/zsh`, with the following terminal command.

$ chsh -s /bin/zsh

### Switch to a zsh prompt

Zsh recognizes a different set of prompt specifiers than bash, so you may need to modify some settings previously used in your bash profile.

If you’re starting from scratch, here’s 3 steps to add a custom prompt with an emoji as well as other information about the current git repository.

#### Step 1: install oh-my-zsh

Install [Oh My Zsh](https://github.com/ohmyzsh/ohmyzsh), an open source framework for managing your [zsh](https://www.zsh.org/) configuration, by running this curl command in your terminal.

$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

#### Step 2: update your theme and plugins

Use your favorite text editor to open your `~/.zshrc` config file located in your `$HOME` directory.

$ code ~/.zshrc

This config file is where you can update your theme for a different look and feel by selecting one of the [many available themes](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes), or leave it the default theme.

\# in ~/.zshrc  
\# pick theme  
ZSH\_THEME="robbyrussell"

You can also add a plugin to this config file by selecting a few of the [many available plugins](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins), like `[git-prompt](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git-prompt)` to display information about the current directory.

\# in ~/.zshrc  
\# add plugin  
plugins=(  
  git-prompt  
)

#### Step 3: customize the prompt

Use your favorite text editor to open your oh my zhs theme to further customize your terminal prompt.

$ code ~/.oh-my-zsh/themes/robbyrussell.zsh-theme

Tweak the theme by updating various parts of the `PROMPT` string. You can use a [zsh prompt generator](https://zsh-prompt-generator.site/) to easily configure, bold, or colorize more elements. Paste in your own emoji, or use **Ctrl + Cmd + Space** on Mac to open up the emoji keyboard.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1735163471010/2909bc6e-24af-4da5-a963-164344d2de8f.png)

customize prompt with emoji and git status

Another option is to add a conditional emoji based on the success of the previous command. In this example, an Octopus will display in the prompt if the preceding command succeeds, otherwise a Dinosaur.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1735163472501/9a379e07-1d33-4ea6-bf94-dc92f1f70554.png)

customize with conditional emojis

Save your changes, and open a new terminal tab to inspect your newest Octopus friend 🐙!
