A short while ago I asked this question, on how to customise the bash terminal font colours. The question was answered and I got the colours wanting, using the link provided by a helpful user.
The command I was looking for was:
export PS1="\e[1;34m\u@\H : \e[m\[$(tput sgr0)\]"
Which gives me the following, in the desired colour:
user@host :
However, after using this for a while, I notice that my bash terminal is now pretty buggy when recording and accessing the command history. This thread describes the exact issue I'm having, and the solution being, "use \[...\]
around the parts of PS1 that have length 0".
I feel like I've tried everything to do exactly that in my PS1, but the history still remains buggy. Can someone please point out what I'm missing?
export PS1="\[\e[1;34m\u@\H : \e[m\[$(tput sgr0)\]\]"
– George Udosen May 01 '17 at 22:05