bash 3.0-7 bug - prompt length with non-printing characters

Max Bowsher maxb@ukf.net
Sun Jul 10 19:05:00 GMT 2005


I have a prompt ($PS1) which includes non-printing characters. They are 
enclosed with \[ .... \] so that bash knows not to count them in discovering 
the length of the prompt in order to position the cursor correctly.

On upgrading to bash 3, I noticed that the last few characters of my prompt 
were erroneously duplicated (it ended with two $ signs). When tab completion 
was used, the text got nastlily corrupted.

Here is a reproduction case:

PS1='\[\e[32;1m\]@\[\e[33;1m\]#\[\e[0m\] $ '

Curiously, appending '\[\]' to the end of $PS1 works around the problem.

Max.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list