Color hostname whether you're root or in ssh

This commit is contained in:
Henrik Lissner 2015-12-12 17:39:23 -05:00
parent 6c77b81b43
commit d61c4d5e03

View file

@ -104,11 +104,8 @@ prompt_init() {
zstyle ':vcs_info:git*' formats ':%b' zstyle ':vcs_info:git*' formats ':%b'
zstyle ':vcs_info:git*' actionformats ':%b (%a)' zstyle ':vcs_info:git*' actionformats ':%b (%a)'
# show username@host if logged in through SSH # show username@host if logged in through SSH OR logged in as root
[[ "$SSH_CONNECTION" != '' ]] && prompt_username='%n@%m ' [[ "$SSH_CONNECTION" != '' || "$UID" -eq 0 ]] && prompt_username='%F{white}%n%F{244}@%m '
# show username@host if root, with username in white
[[ $UID -eq 0 ]] && prompt_username='%F{white}%n%F{242}@%m '
## Vim cursors ## Vim cursors
N_MODE="%F{blue}## " N_MODE="%F{blue}## "