Matthew Woehlke wrote: >>>> 1. Set PS1="\033[01;37m[ \[\033[01;34m\]\w\[\033[00m\] >>>> \033[01;37m]\n\$\033[00m " >>> You need to bracket _every_ nonprinting sequence of characters with >>> \[\]. >> >> I've asked you before, but you've not answered, or it got lost. >> >> What nonprinting sequence is not escaped above? > > Two occurrences of "\033[01;37m]".
I see now. Thanks for pointing at it. Fixing the PS1 above still triggers the bug, if you use "ls ./_ /fooooo" though. Please note that the PS1 above does not come from me, but from a bug comment. There seems to be an issue Can you reproduce the bug with PS1="\n\[\033[0m\]" (which seems to be valid as far as I can see)? I can trigger the misplacement of the cursor there with just "ls ./", followed by tab-tab, while PS1="\[\033[0m\]\n" works. It seems to get triggered by a newline and following non-printable characters.