PS1 line-wrapping with colours problem

Got it, needed to escape the colours properly.

Fix:

PS1='\u:\W$(__git_ps1 "\[\e[32m\][%s]\[\e[0m\]")$ '

May I suggest the following method for colors in Bash, it makes the code much more readable and alot harder for you to miss an escape or two.

Put the following in your ~/.bashrc

BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
LIME_YELLOW=$(tput setaf 190)
YELLOW=$(tput setaf 3)
POWDER_BLUE=$(tput setaf 153)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
WHITE=$(tput setaf 7)
BRIGHT=$(tput bold)
NORMAL=$(tput sgr0)
BLINK=$(tput blink)
REVERSE=$(tput smso)
UNDERLINE=$(tput smul)

A sample PS1 (or really anything that prints to the screen) would be:

 PS1="\[${WHITE}\](\[${YELLOW}\]\u@\h\[${WHITE}\])\[${NORMAL}\]$ "

You need only put \[ \] around the color words.

If you have a 256-color terminal, you can experiment with other numerical values to 'tput setaf' all the way up to 255.