mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-18 20:00:07 +00:00
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
This commit is contained in:
parent
ea7b886f70
commit
2fce9a4d44
1 changed files with 1 additions and 1 deletions
|
@ -89,7 +89,7 @@ prompt_end() {
|
||||||
# Context: user@hostname (who am I and where am I)
|
# Context: user@hostname (who am I and where am I)
|
||||||
prompt_context() {
|
prompt_context() {
|
||||||
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue