zsh: prompt: use ZLE_RPROMPT_INDENT in tmux to fix prompt whitespaces

This commit is contained in:
Thomas Preisner 2017-10-06 23:22:19 +02:00
parent 2bd6fd9eb4
commit 119f365424

View file

@ -74,8 +74,15 @@ 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"
# use %{ .. %} for bottom_right_corner to remove useless space after RPROMPT # use %{ .. %} for bottom_right_corner to remove useless space after RPROMPT
local bottom_suffix="%F{cyan}%{${bottom_right_corner}%}%f" # remove useless space after RPROMPT
if [[ $TERM != "tmux-256color" ]]; then
# 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=""