If I set my command prompt like:
export PS1=\'\\033[0;33m[\\u@\\h \\w]\\$ \\033[00m\'
The color of the prompt will be yellow and everything
You need to enclose the non-printing characters in \[ ... \] so that bash knows to ignore them when computing the length of the prompt:
\[ ... \]
bash
export PS1='\[\033[0;33m\][\u@\h \w]\$ \[\033[00m\]'