This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Prompt issue within cygwin

Hash: SHA1

According to Igor Peshansky on 1/23/2006 4:18 PM:
>>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?

Shoot - the bug is still not fixed upstream; I reproduced it with
bash-3.1-1, readline-5.1-1, and rxvt-2.7.10-6.  One of these days, I hope
to be able to sit down and figure out where readline is going wrong (it is
either a readline bug, or a bug in the terminfo database), but it is
painful to debug.

> 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.

Unfortunately, appending \[\] to PS1 no longer works with readline-5.1,
since upstream "fixed" readline to recognize that an empty non-printing
sequence has no effect on the location of the last non-printing character.
 However, I think I might be able to recussitate my readline-5.0 hack that
forcefully treats a single-line prompt with non-printing characters as
though it had a \[\] appended (and I hope I can make it work at a lower
level then where empty \[\] is stripped from PS1).  It may be a while, but
I plan on providing readline-5.1-2 that works around this nasty prompt bug
as soon as I can.

- --
Life is short - so eat dessert first!

Eric Blake   
volunteer cygwin readline maintainer
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Thunderbird -


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]