From 2fce9a4d44f822c03ce874268338961d0761f1a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 17 Oct 2018 20:53:07 +0200 Subject: [PATCH] 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 --- themes/agnoster.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }