Prompt issue within cygwin

Peter D. Stout pds@edgedynamics.com
Mon Jan 23 23:57:00 GMT 2006


On Mon, 23 Jan 2006 15:18:20 -0800, Igor Peshansky wrote:

> On Mon, 23 Jan 2006, Zach Gelnett wrote:
>
>> On 1/23/06, Zach Gelnett <zachg99@XXXXX.XXX> wrote:
>> > On 1/23/06, Igor Peshansky <pechtcha@XX.XXX.XXX> wrote:
>
> Again, <http://cygwin.com/acronyms/#PCYMTNQREAIYR>.  Let's not feed the
> spammers.
>
>> [snip]
>> I do have one final question.
>>
>> If I set PS1 like this:
>>
>>  PS1="\[\033]61;\w\007\]\u@\h:\w\\$ "
>>
>> Everything works great, no issues at all, what is expected is what is
>> displayed.
>>
>> Now, when i make only a slight modification as such:
>>
>> PS1="\[\033]61;\u@\H\007\]\u@\h:\w\\$ "
>>
>> all the sudden i have a duplicate space after my prompt as in:
>>
>> v468929@TRD-CAX40JXD:~$  ls db2Mgr.
>>
>> that goes away when i hit the tab complete button to show me my options:
>>
>> v468929@TRD-CAX40JXD:~$  ls db2Mgr.
>> db2Mgr.C  db2Mgr.h
>> v468929@TRD-CAX40JXD:~$ ls db2Mgr.
>>
>> I'm trying to get this prompt to work:
>>
>> PS1="\[\033]61;\u@\H\007\]\u@\H \W>"
>>
>> but the issue there is that the > is duplicated (just like the space
>> above, but much more noticable).  Any ideas as to why making the title
>> modification to use \u@\H instead of \w is causing these issues?
>
> There is a prompt bug in bash that causes it to miscount the number of
> displayed characters.  One workaround was to append '\[\]' to PS1.  Also,
> a good habit to get into is to use single quotes in the shell when some
> value contains backslashes.
>
> However, I can't reproduce your problem on my system (I only see one '>'
> with the above PS1 setting).  I don't believe you've posted the
> information requested in the problem reporting guidelines at
> <http://cygwin.com/problems.html> in this thread...  Please attach the
> output of "cygcheck -svr" so that we can find out, among other things,
> what version of bash you are using, as well as what else is different in
> our setups.
> 	Igor

This appears to be a regression in version 5.1-1 of libreadline6.  Based  
on past discussion of how to work around the prompt issue, I use the  
following bash prompt (with rxvt):

PS1='\[\e]0;${WINDOW_TITLE}\u@\h \w\a\]\u@\h\$ \[\]'

With version 5.0-4 of libreadline6, I get one space at the end of my  
initial prompt.  With version 5.1-1 of libreadline6, I get two spaces at  
the end of my initial prompt.  Both versions of libreadline6 duplicate the  
last character on the line under some circumstances when I use control-L  
to refresh the screen.  I have attached the requested cygcheck output with  
each version of the library installed.

					-Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck-old.log
Type: application/octet-stream
Size: 42723 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20060123/6c9231f3/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck-new.log
Type: application/octet-stream
Size: 42723 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20060123/6c9231f3/attachment-0001.obj>
-------------- next part --------------
--
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