5

Colored text set up with PS1 and colored output from commands mess each other up

view full story
linux-howto

http://unix.stackexchange.com – I have PS1 that ends with an opening color sequence (like \[\e[0;32m\]) to have all text in the terminal colored (green in this case). However, when I use a command such as ls (which is aliased to ls --color=auto in my .bashrc) the colors in the output are a little messed up: green up to the first "colored" word, and the following uncolored text is white instead of green. Is there a way to have clean output in all cases? I'm okay with white as "default" text color when the output has colors, but I'd like it to be consistent. Of course, I'd most like a solution that would automatically apply (HowTos)