From e93838eab4d7db664545eba6fe064a34dcc70cdf Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 8 Jan 2017 20:29:49 -0500 Subject: [PATCH] shell/zsh: show user@host on prompt in ssh --- shell/zsh/prompt.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/shell/zsh/prompt.zsh b/shell/zsh/prompt.zsh index f8816f65..0e5ed563 100644 --- a/shell/zsh/prompt.zsh +++ b/shell/zsh/prompt.zsh @@ -64,8 +64,9 @@ prompt_init() { zstyle ':vcs_info:git*' formats ':%b' zstyle ':vcs_info:git*' actionformats ':%b (%a)' - # show username@host if logged in through SSH OR logged in as root - is-ssh || is-root && prompt_username='%F{magenta}%n%F{244}@%m ' + # show username@host if logged in through SSH + prompt_username= + is-ssh && prompt_username='%F{magenta}%n%F{244}@%m ' ## Vim cursors if [[ "$SSH_CONNECTION" ]]; then @@ -77,7 +78,7 @@ prompt_init() { fi RPROMPT='%F{cyan}${vcs_info_msg_0_}$(prompt_git_dirty)%f' - PROMPT='%F{cyan}%~ %f${PROMPT_SYMBOL:-$ }%f' + PROMPT='${prompt_username}%F{cyan}%~ %f${PROMPT_SYMBOL:-$ }%f' } prompt_init "$@"