bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: incorrect handling of invisible characters in prompt string


From: Eric Blake
Subject: Re: incorrect handling of invisible characters in prompt string
Date: Thu, 14 Jul 2005 06:42:14 -0600
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This bug is insidious, as there is more than one wrong string printed to
the display.  For example, this screenshot shows that the original prompt
doubles the last prompt character ($), but after tab completion has
displayed a list, it doubles the first user-character (a).  From there,
using the arrow keys to go back, then forward in history, corrects the
display:

$ PS1='\[\e]0;1\a\]$'
$$a[TAB]
a/                     am4tPD2876/            atrace.dll
a2p.exe                amcompat.tlb           attrib.exe
...
alrsvc.dll             atobm.exe
$aa[UP]
$aPS1='\[\e]0;1\a\]$'[DOWN]
$a[UP]
$PS1='\[\e]0;1\a\]$'

Also, someone on the cygwin mailing list suggested that a workaround is to
fake bash into thinking that the last invisible character is the last
prompt character:

PS1='\[\e]0;1\a\]$\[\]'

This solves the problem of the initial prompt, but not the display after
tab-completion.  And it points out a flaw in the readline expand_prompt()
logic for letting a zero-length \[\] invisible character marker pair
change the *lip parameter to an index of a non-invisible character.

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

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC1l2m84KuGfSFAYARAjovAJ9yhImh8VspYSn6+WClv/2XmRQnDQCglY71
NJMZ0WIZpsjE8ziJk1zOrwo=
=3wfB
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]