diff --git a/pure.zsh b/pure.zsh index cd55a3fa..999e92b4 100644 --- a/pure.zsh +++ b/pure.zsh @@ -464,6 +464,11 @@ prompt_pure_setup() { # if a virtualenv is activated, display it in grey PROMPT='%(12V.%F{242}%12v%f .)' + # if PURE_ROOT_HASH is set and we are root then prefix prompt with a red hash '#' + if (( ${PURE_ROOT_HASH:0} )) && [[ $UID -eq 0 ]]; then + PROMPT+='%F{red}# ' + fi + # prompt turns red if the previous command didn't exit with 0 PROMPT+='%(?.%F{magenta}.%F{red})${PURE_PROMPT_SYMBOL:-❯}%f ' } diff --git a/readme.md b/readme.md index d2fbc01b..0a4ebad1 100644 --- a/readme.md +++ b/readme.md @@ -109,6 +109,10 @@ Defines the git down arrow symbol. The default value is `⇣`. Defines the git up arrow symbol. The default value is `⇡`. +### `PURE_ROOT_HASH` + +Set `PURE_ROOT_HASH=1` to prefix prompt with a red `#` if we are root. + ## Example ```sh