Customise Bash Terminal Font Colours

by Klicker   Last Updated May 01, 2017 22:02 PM

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?



Related Questions


Change Terminal 'user@host' colours - Gnome

Updated April 20, 2017 22:02 PM

How to save terminal history manually?

Updated June 09, 2015 03:01 AM

Bash history handling with multiple terminals

Updated July 19, 2018 11:02 AM

Trap gnome-terminal close button

Updated October 07, 2015 05:01 AM

Ubuntu 17.04 vim colors

Updated July 07, 2017 07:02 AM