Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 24 Aug 2005 14:07:54 -0500 (CDT) From: Suan Yong To: cygwin AT cygwin DOT com Subject: readline clash with bash/PS1 escapes Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, After a recent cygwin update (including one just today), I'm seeing a bug in the readline completion that I finally tracked down to the control sequences in my PS1 for setting the title bar and coloring my prompt. It looks like the '\[' and '\]' delimeters are screwing it up. Here are the symptoms (~> is my prompt). ~>env | fgrep PS1 PS1=\[\033]0;\W\007\]\[\033[32m\]\w>\[\033[0m\] When I type: ls . I see: ---------------------------- ~>ls . ./ .bash_history .cvsrc .ssh/ .vimrc ../ .bash_profile .history .vim/ .Xdefaults .bashrc .inputrc .viminfo ~>ls . . ----------^----------------- Notice the extra " ." in the re-rendered line (^ indicates the prompt position). Something is clearly out of sync. For example, if I then type: Control-U I see: ---------------------------- ~>ls . ./ .bash_history .cvsrc .ssh/ .vimrc ../ .bash_profile .history .vim/ .Xdefaults .bashrc .inputrc .viminfo ~>ls ----^----------------------- where the prompt is overlapping the "ghost" letters "ls", which aren't really in the buffer. E.g., if I then type: p I see: ---------------------------- ~>ls . ./ .bash_history .cvsrc .ssh/ .vimrc ../ .bash_profile .history .vim/ .Xdefaults .bashrc .inputrc .viminfo ~>ps bash: p: command not found ~> ----^----------------------- After some experimentation, I found that if I removed the '\[' and '\]' delimiters from my PS1, the errant behavior goes away. The control sequences evidently still work, even though the man page for bash suggests that they really should be enclosed within \[ \]. Suan -- 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/