From 071d8e19b77529a718ead7655e7976ef46d960f8 Mon Sep 17 00:00:00 2001 From: Gea-Suan Lin Date: Sat, 22 Mar 2014 12:22:29 +0800 Subject: [PATCH] Add \e[K to PS1 (zsh). --- .zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index 6eb9d40..10451d7 100644 --- a/.zshrc +++ b/.zshrc @@ -42,9 +42,9 @@ zstyle ':vcs_info:git*' formats "%b" precmd() { vcs_info if [[ -z "$WINDOW" ]]; then - PS1=$'%{\e[G\e[m\e[32m%}%n%{\e[m%}@%{\e[36m%}%m%{\e[m%} [%{\e[32m%}%~%{\e[m%}] [%{\e[36m%}%D{%R}%{\e[m%}] ' + PS1=$'%{\e[m\e[G\e[K\e[32m%}%n%{\e[m%}@%{\e[36m%}%m%{\e[m%} [%{\e[32m%}%~%{\e[m%}] [%{\e[36m%}%D{%R}%{\e[m%}] ' else - PS1=$'%{\e[G\e[m\e[32m%}%n%{\e[m%}@%{\e[36m%}%m%{\e[m%} [%{\e[32m%}%~%{\e[m%}] [%{\e[36m%}%D{%R}%{\e[m%}/%{\e[36m%}W${WINDOW}%{\e[m%}]%{\e[0m%} ' + PS1=$'%{\e[m\e[G\e[K\e[32m%}%n%{\e[m%}@%{\e[36m%}%m%{\e[m%} [%{\e[32m%}%~%{\e[m%}] [%{\e[36m%}%D{%R}%{\e[m%}/%{\e[36m%}W${WINDOW}%{\e[m%}]%{\e[0m%} ' fi if [[ ! -z "$vcs_info_msg_0_" ]]; then PS1+=$'%{\e[1;30m%}(${vcs_info_msg_0_})%{\e[m%} '