diff options
author | Matthías Páll Gissurarson <mpg@mpg.is> | 2015-11-17 22:06:49 +0300 |
---|---|---|
committer | Matthías Páll Gissurarson <mpg@mpg.is> | 2015-11-17 22:37:59 +0300 |
commit | 47eb8f10ac798cada32e91613bdcde8a44378a2f (patch) | |
tree | f7ebf015590ebced58c73455200b15f0cea44b57 /powerlevel9k.zsh-theme | |
parent | 6d3899b6e39a4699bfe35038544ca366bcfdcade (diff) |
added variable to have rprompt on the newline
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-x | powerlevel9k.zsh-theme | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index b039f0d7..3fe2c708 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -901,14 +901,19 @@ powerlevel9k_prepare_prompts() { if [[ "$POWERLEVEL9K_PROMPT_ON_NEWLINE" == true ]]; then PROMPT="$(print_icon 'MULTILINE_FIRST_PROMPT_PREFIX')%{%f%b%k%}$(build_left_prompt) $(print_icon 'MULTILINE_SECOND_PROMPT_PREFIX')" - # The right prompt should be on the same line as the first line of the left - # prompt. To do so, there is just a quite ugly workaround: Before zsh draws - # the RPROMPT, we advise it, to go one line up. At the end of RPROMPT, we - # advise it to go one line down. See: - # http://superuser.com/questions/357107/zsh-right-justify-in-ps1 - local LC_ALL="" LC_CTYPE="en_US.UTF-8" # Set the right locale to protect special characters - RPROMPT_PREFIX='%{'$'\e[1A''%}' # one line up - RPROMPT_SUFFIX='%{'$'\e[1B''%}' # one line down + if [[ "$POWERLEVEL9K_RPROMPT_ON_NEWLINE" != true ]]; then + # The right prompt should be on the same line as the first line of the left + # prompt. To do so, there is just a quite ugly workaround: Before zsh draws + # the RPROMPT, we advise it, to go one line up. At the end of RPROMPT, we + # advise it to go one line down. See: + # http://superuser.com/questions/357107/zsh-right-justify-in-ps1 + local LC_ALL="" LC_CTYPE="en_US.UTF-8" # Set the right locale to protect special characters + RPROMPT_PREFIX='%{'$'\e[1A''%}' # one line up + RPROMPT_SUFFIX='%{'$'\e[1B''%}' # one line down + else + RPROMPT_PREFIX='' + RPROMPT_SUFFIX='' + fi else PROMPT="%{%f%b%k%}$(build_left_prompt)" RPROMPT_PREFIX='' |