Customizing your Mac’s Terminal

JJ
6 min readJan 11, 2025

--

I recently got a new Mac Mini and remembered how bad the default UI is for Terminal. Here’s how you can improve it using Oh My Zsh and the Powerline10k theme to have a better developer experience and reduce strain on your eyes.

Note: We’ll be using macOS’s default Terminal app instead of installing an alternative. iTerm2 is the most popular alternative suggested in most articles on this topic; however, iTerm2’s features aren’t particularly useful to me at this point, so I prefer to stick with the default Terminal app to minimize security risks.

Prerequisites

You’ll need to have Apple’s Xcode Command Line Tools installed so that we can use the git command later. Xcode Command Line Tools can be installed by typing the following into Terminal:

xcode-select --install

Alternatively, you get Xcode Command Line Tools included as part of Homebrew (a popular package manager). Homebrew is used to install, update, and manage applications and developer tools that aren’t included with macOS.

You can check if you have Homebrew with the brew -v command.
If Homebrew is NOT installed, you will see the following response:
zsh: command not found: brew

You can install Homebrew by entering this command from https://brew.sh/:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Once Homebrew install is done, it will ask you to “Run these commands in your terminal to add Homebrew to your PATH.”

echo >> /Users/YOUR-USERNAME/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/YOUR-USERNAME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

Note: the commands need to include YOUR USERNAME. So copy what you see in your Terminal and NOT this article.

Install ‘Oh My Zsh’

In 2019, Apple replaced Bash with Zsh as the default shell for macOS. The reason for this seems to be a mix of 1) Zsh having some better features (like tab completion, syntax highlighting, plugin support, etc) and 2) Bash adding stricter copyright / licensing requirements with its newer versions.

Oh My Zsh is the most popular framework for managing Zsh configurations and is the foundation for many Zsh themes. To install Oh My Zsh, enter this command from https://ohmyz.sh/#install:

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

Oh My Zsh comes with many themes options. You can find them in the Users > your-username > .oh-my-zsh > themes folder.

You can change themes by opening the .zshrc file (which is also found in Users > your-username) and editing the variable ZSH_THEME="robbyrussell".

Note: both .oh-my-zsh and .zshrc are hidden folders & files, so you’ll need to press Command + Shift + Period (.) for them to become visible in Finder.

Side note: some themes, like “agnoster”, will require powerline fonts in order to support special characters. The most commonly recommend powerline font is “Meslo LG M DZ for Powerline” (Regular style and 11px size).

However, the theme we want (Powerlevel10k) is NOT included by default with Oh My Zsh.

Install Meslo Nerd Font

For the Powerlevel10K theme to work properly, we’ll need to first install the recommended Meslo Nerd Font. There are 4 ttf files for this font. Download and install them all. Then update Terminal to use the font:

  • Open Terminal → Settings.
  • Go to the “Profiles” tab and “Text” sub-tab.
  • Click “Change” under the “Font” section.
  • Select “MesloLGS NF” for Typeface, “Regular” for Style, and “11” for Size.

Install Powerlevel10k theme

Powerlevel10k is one of the most popular themes for zsh, and what makes it special is the Configuration Wizard that helps guide you through the many possible customizations (more on that later).

For Oh My Zsh users (i.e. us), the command to download Powerlevel10k is:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

The theme will be download in:
Users > your-username > .oh-my-zsh > custom > themes > powerlevel10k.

Open .zshrc and replace ZSH_THEME="robbyrussell" with ZSH_THEME="powerlevel10k/powerlevel10k. Then save the file.

Now quit Terminal (Command + Q) and re-open it. You should be greeted by the Powerlevel10k’s Configuration Wizard. If not, type p10k configure.

The configuration wizard will start by making sure that your Terminal’s font is displaying everything correctly. You’ll be asked to confirm a few symbols and their position and spacing.

Once everything is confirmed to be working, the customizations begin. First, you’ll be asked to pick a Prompt Style. I like the Classic one the best.

Then you’ll be asked to pick a Character Set (Unicode or ASCII). I prefer the ASCII design.

Then you’ll be asked to pick a Prompt Color. I like the Dark one.

Then you’ll be asked to pick a Time Format. I like the 24-hour format.

Then you’ll be asked to pick a Prompt Height. I strongly recommend Two Lines to avoid the “wall of text” clutter that Terminal is infamous for.

Then you’ll have to pick a Prompt Connect. I prefer Solid. But regardless of what you choose, be aware of the window resizing bug.

Then you’ll be ask to pick Prompt Spacing. I strongly recommend Sparse (again, to avoid having a giant wall of text in your history).

Then you’ll be asked for a Prompt Flow. I recommend Concise.

Then you’ll be asked to Enable Transient Prompt. I strongly recommend No to ensure your Terminal history remains easy to read.

Then you’ll be asked to select Instant Prompt Mode. I couldn’t find any reason not to go with the official recommendation of Verbose.

Then lastly, make sure to select Yes to save the changes to ~/.zshrc.

And we’re finally done! 🥳

Bonus: Welcome Message

Did you know that you can get your macOS Terminal to display more than just your Last Login time when you open a new session?

Check out my tutorial here.

Conclusion

I hope you enjoy the new look of your Mac’s Terminal. Feel free to ask questions in the comments, and share any other nice improvements / customizations that you know of for Terminal. 😊

--

--

JJ
JJ

Written by JJ

Digital nomad, product manager, coder, photographer, and portable monitor enthusiast.

No responses yet