see: http://forums.gentoo.org/viewtopic-t-556878.html escape characters in the default /etc/profile /etc/bash/bashrc PS1 vars aren't contained in \[, \] pairs as per bash spec, leading to strange issues with editing multiline commands, as bash gets confused about spacing, calculating space for characters that do not appear on screen (the colour settings) Reproducible: Always Steps to Reproduce: 1.type a command that takes up 2 lines or more 2.try to edit 3.experience.. the twilight zone! Actual Results: you have to sort of guess where the chars actually are by going over the parts you want to change with the cursor. Expected Results: normal command editing
btw, this is with bash-3.2_p15-r1
PS1 in /etc/profile does not use escape sequences PS1 in the default /etc/bash/bashrc is quoted just fine: files/bashrc: PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] ' files/bashrc: PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '