diff options
author | Ben Hilburn <bhilburn@gmail.com> | 2015-07-19 22:15:26 +0300 |
---|---|---|
committer | Ben Hilburn <bhilburn@gmail.com> | 2015-07-19 22:15:26 +0300 |
commit | 97cd46a347ba3c07d2bbdacfc1b7c8d54278836a (patch) | |
tree | c33260ff370a0112c5aade5e2b1d22866c01a79e /powerlevel9k.zsh-theme | |
parent | 1f69d67c2a9802d00bc6e0f89c06175376c4de71 (diff) | |
parent | eed0c842735d8fe40e024dfd05ac09824f4fc6b2 (diff) |
Merge pull request #58 from dritter/dritter/customizable_context
Made the `context` segment customizable.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rw-r--r-- | powerlevel9k.zsh-theme | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index fd0e3ecd..bef1820a 100644 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -437,7 +437,12 @@ prompt_aws() { # Note that if $DEFAULT_USER is not set, this prompt segment will always print prompt_context() { if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then - $1_prompt_segment "$0" "$DEFAULT_COLOR" "011" "%(!.%{%F{yellow}%}.)$USER@%m" + if [[ $(print -P "%#") == '#' ]]; then + # Shell runs as root + $1_prompt_segment "$0_ROOT" "$DEFAULT_COLOR" "yellow" "$USER@%m" + else + $1_prompt_segment "$0_DEFAULT" "$DEFAULT_COLOR" "011" "$USER@%m" + fi fi } |