How to make an Emoji shell prompt

dmk12
3 min readApr 30, 2016

--

In today’s lesson, we will learn how to make your terminal prompt look like this:

Where the heck do I get the emoji icon from?

If you’re on a Mac, you’re in business.

The short way: use Ctrl + Cmd + Space on Mac to open the emoji keyboard and drag the icon into a text editor so you could copy/paste it.

The long way: let’s dig up the default Emoji font that comes with your Mac. Click on the Language icon in your top menu bar (the little flag beside the clock and battery). Select Show Emoji & Symbols.

If you don’t see this option, go to Preferences > Keyboard, and tick “Show Keyboard, Emoji & Symbols Viewers in menu bar”.

Now select an emoji of your liking, Ctrl/right click it, and select Copy Character Info.

Open your text editor of choice and paste the character info. Select and copy the emoji icon.

Character info in text editor, copy the emoji

Add the emoji to your prompt

Go to your bash config file (~/.bash_profile, ~/.bashrc, or in my case ~/.zshrc, because I use Zsh). Add the following line, and paste in the emoji you copied:

In Zsh the config is a little different:

export PROMPT=“%~ 🤔”

Save the config file, quit your terminal and reopen it. That’s it, let the games begin, let us have some harmless Emoji fun!

Side note: I recommend Zsh if you frequently work with Git — it always tells you which Git branch you’re on, and has nice color coding and custom theme options. However, this little emoji trick, albeit fun, messes with Zsh Git integration, and you’ll need to do some further configuration to bring it back.

Adapted from boingboing.org

--

--