From 5043c868691b7e29c2acf24d3858e8bf7694faf2 Mon Sep 17 00:00:00 2001 From: Artem Sapegin Date: Thu, 21 Feb 2013 18:45:15 +0400 Subject: [PATCH] Bash: new prompt bug fixes. --- includes/bash_prompt.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/bash_prompt.bash b/includes/bash_prompt.bash index 18e5c2a..2505d11 100644 --- a/includes/bash_prompt.bash +++ b/includes/bash_prompt.bash @@ -52,7 +52,9 @@ function prompt_command() { [ -n "$user_prompt" ] || [ -n "$host_prompt" ] && login_delimiter=":" # Format prompt - PS1="\n$user_prompt$host_prompt$login_delimiter$WHITE$dir_name$NOCOLOR$git_prompt\n$CYAN$prompt_symbol$NOCOLOR " + # \033[G moves the cursor to the first column: http://jonisalonen.com/2012/your-bash-prompt-needs-this/ + # Text (commands) inside \[...\] does not impact line length which fixes stange bug when looking through the history + PS1="\033[G\n$user_prompt$host_prompt$login_delimiter$WHITE$dir_name$NOCOLOR$git_prompt\n\[$CYAN\]$prompt_symbol\[$NOCOLOR\] " # Terminal title local title="$(basename $dir_name)"