These color codes are incomplete for some reason beyond my knowledge and fail sometimes when a line is too long, overwriting the prompt's first line content and producing weird behaviours because prompt won't start a new line or even go one line up.
In order for these color codes to work (at least in ubuntu), you need to replace
\e with [\033 and add at the end of every code \].
Bash get unicode character from encoded char
Reply to comment