zsh: prompt.zsh: fix rprompt indent

Various shells apparently do not support ZLE_RPROMPT_IDENT=0 properly
and shift the cursor one to the left. As a result,
autocompleting leads to weird shifting of the user input and
'overlapping' text.
In order to fix this issue, it seems to be sufficient to set
ZLE_RPROMPT_INDENT=-1.

(see https://github.com/bhilburn/powerlevel9k/issues/110)
This commit is contained in:
Thomas Preisner 2019-05-22 16:19:31 +02:00
parent 219bbaf74c
commit 151032b726

View file

@ -89,14 +89,8 @@ zshrc_prompt_precmd() {
# suffix characters in first and second line # suffix characters in first and second line
local top_suffix="%F{cyan}${top_right_corner}%f" local top_suffix="%F{cyan}${top_right_corner}%f"
local bottom_suffix="%F{cyan}${bottom_right_corner}%f" local bottom_suffix="%F{cyan}${bottom_right_corner}%f"
# use %{ .. %} for bottom_right_corner to remove useless space after RPROMPT
# remove useless space after RPROMPT # remove useless space after RPROMPT
if [[ $TERM != "tmux-256color" ]]; then ZLE_RPROMPT_INDENT=-1
# use %{ .. %} for bottom_right_corner if not in tmux
bottom_suffix="%{${bottom_suffix}%}"
else
ZLE_RPROMPT_INDENT=0
fi
# combine them to create the prompt # combine them to create the prompt
local top_left="" local top_left=""