From 119f3654247d51573e7157f1dd643e9f3149d49b Mon Sep 17 00:00:00 2001 From: Thomas Preisner Date: Fri, 6 Oct 2017 23:22:19 +0200 Subject: [PATCH] zsh: prompt: use ZLE_RPROMPT_INDENT in tmux to fix prompt whitespaces --- zsh/prompt.zsh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zsh/prompt.zsh b/zsh/prompt.zsh index 4a22f2d..ed6218d 100644 --- a/zsh/prompt.zsh +++ b/zsh/prompt.zsh @@ -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=""