zsh: prompt: use ZLE_RPROMPT_INDENT in tmux to fix prompt whitespaces
This commit is contained in:
parent
2bd6fd9eb4
commit
119f365424
1 changed files with 8 additions and 1 deletions
|
|
@ -74,8 +74,15 @@ zshrc_prompt_precmd() {
|
|||
|
||||
# suffix characters in first and second line
|
||||
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
|
||||
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
|
||||
local top_left=""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue