Browse Source

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
Marc Cornellà 5 years ago
parent
commit
2fce9a4d44
1 changed files with 1 additions and 1 deletions
  1. 1 1
      themes/agnoster.zsh-theme

+ 1 - 1
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
 }