bug-bash
[Top][All Lists]
Advanced

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

Annoying prompt length guessing bug


From: Smári P. McCarthy
Subject: Annoying prompt length guessing bug
Date: Sun, 7 Jul 2002 05:23:03 +0000
User-agent: KMail/1.4.1

Hello.

Got a little annoyance regarding $PS1 (and presumably other prompt variables)

I'm running Bash 2.05a.0(1)-release (from Debian apt), and the bug can be 
called by setting the prompt to something containing ANSI color codes, i.e.:

PS1='\033[36m[\A\033[0;1m \u\033[0m@\h\033[0;1m \W\033[0;36m]$\033[0m '

Then filling the command line. After a certain amount of characters, the 
cursor wraps to the begining of the same line, while it shouldn't go anywhere 
for a few more characters (since there is still space on the line), and then 
it should wrap down to the next line.

Each color sequence, i.e. '\033[36m', is counted as one visible char in the 
prompt when it is calculating the length, while it should not be counted at 
all - it's invisible.

I would have supplied a patch, at least a dirty hack.. but I can't seem to 
find exactly where it is that this is done in the code; been grepping for 
cribs for an hour. ;)

Anyway, it would be nice to get a fix... and if anybody replies this, could 
you CC me, I'm not on the list.

Thanks,
        Smári

-- 
Smári P. McCarthy
spm@vlug.eyjar.is



reply via email to

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