summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2018-10-17 20:53:07 +0200
committerGitHub <noreply@github.com>2018-10-17 20:53:07 +0200
commit2fce9a4d44f822c03ce874268338961d0761f1a9 (patch)
treeeb1327c306f8fda150d7add5d534cb8a57648a5c
parentea7b886f701316199cf90761a6e9a2a27659b544 (diff)
downloadzsh-2fce9a4d44f822c03ce874268338961d0761f1a9.tar.gz
zsh-2fce9a4d44f822c03ce874268338961d0761f1a9.tar.bz2
zsh-2fce9a4d44f822c03ce874268338961d0761f1a9.zip
agnoster: use %n instead of $USER to fix quoting
Fixes #7268 With `$USER`, we'd need to quote it in case special characters like `\` are present in the $USER value, like if the user is part of an AD domain. With `%n` the quoting is done automatically by zsh. See http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Login-information
-rw-r--r--themes/agnoster.zsh-theme2
1 files changed, 1 insertions, 1 deletions
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
index 1ac3fc96b..0edb773aa 100644
--- a/themes/agnoster.zsh-theme
+++ b/themes/agnoster.zsh-theme
@@ -89,7 +89,7 @@ prompt_end() {
# Context: user@hostname (who am I and where am I)
prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
- prompt_segment black default "%(!.%{%F{yellow}%}.)$USER@%m"
+ prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m"
fi
}