Skip to content

Instantly share code, notes, and snippets.

@eighty4
Last active February 9, 2023 00:45
Show Gist options
  • Save eighty4/00884fbd13419bc2e9be7d052d0729c8 to your computer and use it in GitHub Desktop.
Save eighty4/00884fbd13419bc2e9be7d052d0729c8 to your computer and use it in GitHub Desktop.
Clean zsh shell prompt
# %(?. . ) is a ternary on the prev process exit code
# %B starts printing bold text until %b
# %F{196} starts printing with a new foreground color until %f
# %~ prints cwd using ~ notation for home dir
# the shell does not add a space so appending a space is customary
PROMPT='%(?. .%F{196}!%f)%B%F{220}%~%f%b '
@eighty4
Copy link
Author

eighty4 commented Feb 9, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment