Adding an Octopus to the Zsh Prompt
Tags: bash, terminal, shell
Published: 2020-07-26 19:40:18

---
title: Adding an Octopus to the Zsh Prompt
published: true
date: 2020-04-05 22:56:24 UTC
tags: bash,terminal,shell
canonical_url: https://medium.com/@joycelin.codes/adding-an-octopus-to-the-zsh-prompt-56edf2e9bcad
cover_image: https://cdn-images-1.medium.com/max/1024/1*RjnYWD_mbYiSEBRsBmdtLA.jpeg
---

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

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 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 profile and 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: clone the repo

To add a git prompt for zsh, clone [this repo](https://github.com/olivierverdier/zsh-git-prompt) somewhere on your hard drive.

```
$ git clone [https://github.com/olivierverdier/zsh-git-prompt.git](https://github.com/olivierverdier/zsh-git-prompt.git)
```

#### Step 2: source the zsh file from your config

Source the file zshrc.sh from your ~/.zshrc config file by referencing the path to where you installed zshrc.sh in the preceding step.

```
# in ~/.zshrc

source path/to/zshrc.sh
```

#### Step 3: configure the prompt

Configure the prompt in the ~/.zshrc config file. Replace my Octopus by pasting in your own emoji, or use **Ctrl + Cmd + Space** on Mac to open up the emoji keyboard.

```
# in ~/.zshrc
# an example prompt

PROMPT='🐙 %~ $(git\_super\_status) '
```

This is what my config file looks like, referencing the location where I installed zshrc.sh, and with my personal preferences for a git prompt. For additional customization, update the PROMPT string. You can use a [zsh prompt generator](https://zsh-prompt-generator.site/) to easily configure, bold, or colorize even more elements.

![](https://cdn-images-1.medium.com/max/1014/1*M0Dv_gOyzVQstlCtII55Dg.png)<figcaption>zsh config file</figcaption>

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

![](https://cdn-images-1.medium.com/max/1024/1*MdcuLM0TqZwxeBh7lcbVbg.png)<figcaption>zsh terminal</figcaption>