1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-18 05:40:07 +00:00

Merge pull request #149 from Tritlo/master

Now allowing the RPROMPT to be on a newline.
This commit is contained in:
Ben Hilburn 2015-11-18 10:54:21 -08:00
commit e79a2ffff0

View file

@ -702,14 +702,19 @@ powerlevel9k_prepare_prompts() {
if [[ "$POWERLEVEL9K_PROMPT_ON_NEWLINE" == true ]]; then if [[ "$POWERLEVEL9K_PROMPT_ON_NEWLINE" == true ]]; then
PROMPT="$(print_icon 'MULTILINE_FIRST_PROMPT_PREFIX')%{%f%b%k%}$(build_left_prompt) PROMPT="$(print_icon 'MULTILINE_FIRST_PROMPT_PREFIX')%{%f%b%k%}$(build_left_prompt)
$(print_icon 'MULTILINE_SECOND_PROMPT_PREFIX')" $(print_icon 'MULTILINE_SECOND_PROMPT_PREFIX')"
# The right prompt should be on the same line as the first line of the left if [[ "$POWERLEVEL9K_RPROMPT_ON_NEWLINE" != true ]]; then
# prompt. To do so, there is just a quite ugly workaround: Before zsh draws # The right prompt should be on the same line as the first line of the left
# the RPROMPT, we advise it, to go one line up. At the end of RPROMPT, we # prompt. To do so, there is just a quite ugly workaround: Before zsh draws
# advise it to go one line down. See: # the RPROMPT, we advise it, to go one line up. At the end of RPROMPT, we
# http://superuser.com/questions/357107/zsh-right-justify-in-ps1 # advise it to go one line down. See:
local LC_ALL="" LC_CTYPE="en_US.UTF-8" # Set the right locale to protect special characters # http://superuser.com/questions/357107/zsh-right-justify-in-ps1
RPROMPT_PREFIX='%{'$'\e[1A''%}' # one line up local LC_ALL="" LC_CTYPE="en_US.UTF-8" # Set the right locale to protect special characters
RPROMPT_SUFFIX='%{'$'\e[1B''%}' # one line down RPROMPT_PREFIX='%{'$'\e[1A''%}' # one line up
RPROMPT_SUFFIX='%{'$'\e[1B''%}' # one line down
else
RPROMPT_PREFIX=''
RPROMPT_SUFFIX=''
fi
else else
PROMPT="%{%f%b%k%}$(build_left_prompt)" PROMPT="%{%f%b%k%}$(build_left_prompt)"
RPROMPT_PREFIX='' RPROMPT_PREFIX=''