From 5538c6763df18be785eff95acf3fbd1806f18419 Mon Sep 17 00:00:00 2001 From: Maciej Sobkowski Date: Thu, 16 Jun 2016 14:50:01 +0200 Subject: bash: Modify PS1 to fix line wrapping Escape sequences in PS1 need to be enclosed in square brackets, otherewise lines break in wrong places and overlap each other. --- bash/.bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash/.bashrc b/bash/.bashrc index eb3e82c..3bdb49a 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -141,7 +141,7 @@ jobscount() { prompt_color() { - PS1="${BLUE}[${GREEN}\t${BLUE}][${YELLOW}\u${GREY}@${PURPLE}\h${GREY}:${CYAN}\W${BLUE}][${RED}\j${BLUE}]${BROWN}$P${PS_CLEAR} " + PS1="\\[\[${BLUE}\][\[${GREEN}\]\t\[${BLUE}\]][\[${COLOR1}\]\u\[${LIGHTGRAY}\]@\[${COLOR2}\]\h\[${LIGHTGRAY}\]:\[${CYAN}\]\W\[${BLUE}\]][\[${RED}\]\j\[${BLUE}\]]\[${GREEN}\]${P}\[${PS_CLEAR}\] " PS2="${P} " } -- cgit v1.2.3-70-g09d2