From 65ed8c446527fd0ccf4bef243c7e6175ddc7fafd Mon Sep 17 00:00:00 2001 From: "hemanth.hm" Date: Tue, 3 Sep 2013 20:37:31 +0200 Subject: [PATCH] Close GH-11: Remote user. Fixes #9 --- pure.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pure.zsh b/pure.zsh index f25ed40..8c92f5c 100644 --- a/pure.zsh +++ b/pure.zsh @@ -32,8 +32,11 @@ # enable prompt substitution setopt PROMPT_SUBST - # only show username if not default - [ $USER != "$PURE_DEFAULT_USERNAME" ] && local username='%n@%m ' + # only show username if not default. + # if SSH_CLIENT or SSH_TTY is defined, it's an ssh session. + if [[ "$SSH_CLIENT" ]] || [[ "$SSH_TTY" ]]; then + local username='%n@%m ' + fi # fastest possible way to check if repo is dirty pure_git_dirty() {