A usable bash prompt

I have done my share of bash scripting, but for the life of me I couldn’t get a color bash prompt working. I used to wire it with code like: PS1="\e[0;31m[\u@\h \W]\$ \e[m " (I got it from sites like cyberciti. And these would never work, it would color the prompt alright, but it would screw up the cursor position. Today, I found that this syntax is actually used to set the cursor position. Anyway, I finally have a bash color prompt working without screwing up my cursor position here it is: