From 3b336a3b653de8a8eeb707b3977f38600a0fce0f Mon Sep 17 00:00:00 2001 From: xyz Date: Tue, 11 May 2021 20:09:45 -0700 Subject: fix PS1 for better line wrap --- .bashrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 91b9d3d5..1a204a14 100644 --- a/.bashrc +++ b/.bashrc @@ -11,7 +11,8 @@ # 0: not bold, 91: bright red # \e[m act like \e[0m, means reset so commands after it will not be colored # https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit -PS1='\e[0;91m[\u@\h \W]\$ \e[0m' +# need \[ and \] around color codes so bash ignore color codes when calculating line wraps +PS1='\[\e[0;91m\][\u@\h \W]\$ \[\e[0m\]' alias ls='ls --color=auto' alias ll='ls -lah --color=auto' -- cgit v1.2.3-70-g09d2