Page 1 of 1

How to Customize Z-Shell Prompt (zsh – macOS, Linux)

How to Customize Z-Shell Prompt (zsh – macOS, Linux)
17

When using Terminal under a recent macOS version, you’ll most likely will be using Z-Shell (zsh) –  a quite common Shell found under Linux as well.
This used to be Bash, but Apple moved to Z-Shell early 2019 (some users may see a message when opening Terminal, requesting them to migrate to zsh).

I do tinker in Terminal quite often and always found the prompt kind-a boring.

In this article: how to customize the Z-Shell prompt.

Note: most of these tricks/settings may work the same way for different shells as well, like Bash and even Linux shell variants.

XTerm Color Cheat Sheet

XTerm Color Cheat Sheet
0

For those who need a cheat sheet on XTerm colors, here a quick and short reference overview.
These colors should work for anything that supports the XTerm color-scheme, so this includes several Terminal emulators and several Shell variants like Z-Shell.

I needed this while customizing my Z-Shell prompt, and I hope this is useful to others as well as a reference sheet.
I’ve split it up in the 16 basic colors, 24 greyscale “colors”, and 256 colors.