bash prompt acting weird when I click UP key and then down KEY
As far as I have been able to tell, this is caused by a bug in iTerm2, where actions such as ctrl+a make it act as though the colour-specifying characters in PS1 are treated as though they have a length.

The best solution I have found is to not specify colours in your .bashrc, and instead use triggers to generate the colours.