[Top][All Lists]

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

Re: readline does not always redraw line very well

From: Chet Ramey
Subject: Re: readline does not always redraw line very well
Date: Tue, 17 Jun 2008 13:08:02 -0400
User-agent: Thunderbird (Macintosh/20080421)

Jan Engelhardt wrote:

Bash Version: 3.2
Patch Level: 25
Release Status: release

Having a prompt with color definitions makes readline reposition
the cursor wrong on many occassions. Here is one of them.

export PS1="\[\e[1;30m\]\A \[\e[0;32m\]\h:\w \[\e[1;37m\]>\[\e[0m\] ";

(type the following verbatim)
echo word1 word2 word3 word4 word5 word6
(now hit keys Alt-4 Alt-b to move the cursor 4 words to the left)

The cursor will be repositioned to a column inside the prompt area
instead of the designated position. I suppose this is due to
readline using (or bash passing in) strlen(PS1) instead of

I can't reproduce this using bash-3.2.39 on Mac OS X with Terminal, aterm,
or xterm.


``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

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