summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-03-19 00:39:15 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-03-19 00:39:15 +0300
commit724f0e6d50dbdb18ebfca9f8be77be470b01d5e2 (patch)
treee66cf9c00d781d824f9e0ec661b18fd9059fda69
parentc38edde02599713bda96a055c7b1b4b347a4558e (diff)
optimize prompt_context
-rwxr-xr-xpowerlevel9k.zsh-theme4
1 files changed, 2 insertions, 2 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 301693de..77467bf4 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -609,11 +609,11 @@ set_default POWERLEVEL9K_ALWAYS_SHOW_USER false
set_default POWERLEVEL9K_CONTEXT_TEMPLATE "%n@%m"
prompt_context() {
local content
- if [[ $POWERLEVEL9K_ALWAYS_SHOW_CONTEXT == true ]]; then
+ if [[ $POWERLEVEL9K_ALWAYS_SHOW_CONTEXT == true || -z $DEFAULT_USER || -n $SSH_CLIENT || -n $SSH_TTY ]]; then
content=$POWERLEVEL9K_CONTEXT_TEMPLATE
else
local user=$(whoami)
- if [[ $user != $DEFAULT_USER || -n $SSH_CLIENT || -n $SSH_TTY ]]; then
+ if [[ $user != $DEFAULT_USER ]]; then
content="${POWERLEVEL9K_CONTEXT_TEMPLATE}"
elif [[ $POWERLEVEL9K_ALWAYS_SHOW_USER == true ]]; then
content="${user//\%/%%}"