diff options
author | Ben Hilburn <bhilburn@gmail.com> | 2017-12-29 22:39:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-29 22:39:13 +0300 |
commit | 200089a91f4d58c28a7973a13e5e89d0b2f73a99 (patch) | |
tree | 49a343aad78e32faafa744f5f18a62da063df0e7 /powerlevel9k.zsh-theme | |
parent | 786dc5b3f211b786d5d77243548f0fec4e1618e4 (diff) | |
parent | 5d645e07bf93b5e29a9fb2fe9b01fa8f2c9b2f27 (diff) |
Merge pull request #709 from tippl/next
Add remote state to context prompt
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-x | powerlevel9k.zsh-theme | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 831e81c5..5ff6291c 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -571,24 +571,25 @@ prompt_context() { context_states=( "ROOT" "yellow" "DEFAULT" "yellow" + "REMOTE" "yellow" ) local content="" if [[ "$POWERLEVEL9K_ALWAYS_SHOW_CONTEXT" == true ]] || [[ "$(whoami)" != "$DEFAULT_USER" ]] || [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then - - if [[ $(print -P "%#") == '#' ]]; then - current_state="ROOT" - fi - content="${POWERLEVEL9K_CONTEXT_TEMPLATE}" - elif [[ "$POWERLEVEL9K_ALWAYS_SHOW_USER" == true ]]; then content="$(whoami)" else return fi + if [[ $(print -P "%#") == '#' ]]; then + current_state="ROOT" + elif [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then + current_state="REMOTE" + fi + "$1_prompt_segment" "${0}_${current_state}" "$2" "$DEFAULT_COLOR" "${context_states[$current_state]}" "${content}" } |