bug-bash
[Top][All Lists]
Advanced

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

ansi escape sequences in prompt mess-up the command prompt


From: Antonis
Subject: ansi escape sequences in prompt mess-up the command prompt
Date: Sun, 6 Nov 2005 03:34:56 -0800 (PST)

GNU bash, version 3.00.16(1)-release (i686-pc-linux-gnu)

Using ansi escape sequences in the prompt causes Bash to incorrectly
calculate the available width of the terminal and messes-up the command
prompt when a certain amount of characters are typed in.

For example type in a terminal the following:

PS1='\e[1;33m\h\e[0m \$ '

in this prompt there are two escape sequences that should consume zero
characters out of the available width of the command line. But they
consume 11 characters in total (the first escape sequence 7 characters
and  the second 4).

Now start typing characters in the command prompt. The command line
will get messed-up 11 characters before reaching the end of the line.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

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