Close #94 PR: Show when root.

This commit is contained in:
Michael Robinson
2014-12-15 12:50:28 +07:00
committed by Sindre Sorhus
parent 2577a4cc07
commit 09740f68ea

View File

@@ -117,6 +117,9 @@ prompt_pure_setup() {
# show username@host if logged in through SSH # show username@host if logged in through SSH
[[ "$SSH_CONNECTION" != '' ]] && prompt_pure_username='%n@%m ' [[ "$SSH_CONNECTION" != '' ]] && prompt_pure_username='%n@%m '
# show username@host if root, with username in white
[[ $UID -eq 0 ]] && prompt_pure_username='%F{white}%n%F{242}@%m '
# prompt turns red if the previous command didn't exit with 0 # prompt turns red if the previous command didn't exit with 0
PROMPT='%(?.%F{magenta}.%F{red})%f ' PROMPT='%(?.%F{magenta}.%F{red})%f '
} }