bug-bash
[Top][All Lists]
Advanced

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

Re: Readline 8.3 regression: Prompt corruption with multibyte characters


From: Chet Ramey
Subject: Re: Readline 8.3 regression: Prompt corruption with multibyte characters
Date: Sun, 5 Jul 2026 13:29:08 -0400
User-agent: Mozilla Thunderbird

On 7/3/26 5:53 AM, Juan Monroy Nieto via Bug reports for the GNU Bourne Again SHell wrote:

I believe I’ve found a prompt display error in Readline 8.3: the prompt gets 
shoved into the start of the line during a redraw when the previous command’s 
output lacks a trailing newline.

If readline doesn't start in column 0, all display bets are off.

It's possible that a different strategy used to move around the line,
especially after the text on the line wraps, leads to display corruption at
a different point. However, if readline isn't where it thinks it is on the
line, you will eventually get display corruption. This is exacerbated by
having to keep track of the difference between the cursor's physical
column and the offset in the line buffer, including invisible characters.

For example, if readline starts in physical column 42 instead of column 0,
and after drawing the prompt is in physical column 44 instead of 2, the
redisplay thinks it can backspace twice to move to column 0 (or worse,
readline thinks it can use a carriage return to move the cursor back to
column 0 and move from there). This isn't going to work, of course, because
readline isn't where it thinks it is.

Readline could force this, by printing a \r to make sure the cursor is in
column 0, but then you'd get complaints about overwriting the line
contents.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

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