This is the mail archive of the
cygwin
mailing list for the Cygwin project.
bash 3.0-7 bug - prompt length with non-printing characters
- From: "Max Bowsher" <maxb at ukf dot net>
- To: "Cygwin" <cygwin at cygwin dot com>
- Date: Sun, 10 Jul 2005 20:05:32 +0100
- Subject: bash 3.0-7 bug - prompt length with non-printing characters
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/