Learn how to customize the zsh prompt in Terminal to make it stand out regardless of your background.

The tilde (~) indicates the prompt’s location in the home directory.

You won’t find this dotfile by default on macOS, so you’ll have to make one.

A person using Terminal on their MacBook Pro

Smartmockups

If it already exists, the command won’t do anything.

That’ll create a .zshrc profile in your user account’s home directory.

After that, the zsh profile will be available for non-login interactive shells every time you launch Terminal.

Default View of zsh prompt

Here’s how to go about that.

However, if it didn’t exist when you ran thetouchcommand above, it’ll be blank.

Open a newTerminalwindow by hittingCmd + Tto confirm and view the changes you’ve just made.

Use only the username in the zsh prompt

If you wish to have a custom username, replace%nwith your preferred choice.

you’re free to include or remove information from the zsh prompt to suit your preference.

If this sounds too complex, use a site likeZsh Prompt Generatorto help you customize your Z shell.

zsh prompt displaying custom information

Similarly, you might put%Sat the start and%sat the end to highlight the text.

The highlight will carry the same color you’ve chosen to appear between the%Sand%svariables.

you’re able to also underline the text of the zsh prompt.

How to add date to the zsh prompt

Alternatively, it’s possible for you to safely delete thePROMPT/PS1andRPROMPTvariables in the .zshrc file.

Don’t worry, because the prefs in the .zshrc file only apply to the current user profile.

you’re able to bold, underline, shorten, and even include more information in it.

How to show Time on the zsh prompt

Displaying date and time information on the right side of the zsh prompt in Terminal

How to add color the zsh prompt

How to bold text in the zsh prompt text

How to Highlight the zsh prompt

How to Underline the zsh prompt