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() {