From d61c4d5e0396daf97215b509320bc62d81260817 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 12 Dec 2015 17:39:23 -0500 Subject: [PATCH] Color hostname whether you're root or in ssh --- zsh/prompt.zsh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/zsh/prompt.zsh b/zsh/prompt.zsh index fac28f71..c01e972b 100644 --- a/zsh/prompt.zsh +++ b/zsh/prompt.zsh @@ -104,11 +104,8 @@ prompt_init() { zstyle ':vcs_info:git*' formats ':%b' zstyle ':vcs_info:git*' actionformats ':%b (%a)' - # show username@host if logged in through SSH - [[ "$SSH_CONNECTION" != '' ]] && prompt_username='%n@%m ' - - # show username@host if root, with username in white - [[ $UID -eq 0 ]] && prompt_username='%F{white}%n%F{242}@%m ' + # show username@host if logged in through SSH OR logged in as root + [[ "$SSH_CONNECTION" != '' || "$UID" -eq 0 ]] && prompt_username='%F{white}%n%F{244}@%m ' ## Vim cursors N_MODE="%F{blue}## "