Terminal 101: Customizing the Zsh Interface

Every Monday, we’ll show you how to do something new and simple with Apple’s built-in command line application. You don’t need any fancy software, or a knowledge of coding to do any of these. All you need is a keyboard to type ’em out!

Last time, we showed you why and how to utilize Zsh as your main shell in Terminal. By now, you’re probably in love with the Z shell, and the tab completion and auto-correction features. But, you might be wondering why Zsh looks so bland. This week, we’ll show you how to spice up Zsh and customize it to your liking.

Setting Your Zsh Theme

The default theme that is included with Oh-My-Zsh (the shell that we installed last week) is “robbyrussell.” It’s a very basic theme; however, there are a lot more themes that can be applied to Zsh. We’ll walk you through a few of our favorites, and show you how to change the theme, or randomize it.

To begin, type the following command to open the Zsh configuration file to edit in nano:

nano ~/.zshrc

When the file opens, locate the line that says “ZSH_THEME” and ensure that the beginning of that line does not have a “#” in front (meaning it’s commented out). You’ll type in the theme name in the double quotes after the equal sign, so that the line looks like this:

ZSH_THEME=”af-magic”

When you’re ready to save, press Control + O (WriteOut File), and then Enter to save over the file. Next, Press Control + X to exit out of the nano text editor.

To see your new theme, close out of the currently opened Terminal window, and open a new one to start a new session. If everything was set correctly, then you’ll see the new theme activate.

Make It Random

If you set the theme to “random,” then Zsh will automatically load a random theme whenever oh-my-zsh is loaded.

Our Top 5 Zsh Themes