Subject: Re: bug#57728: 29.0.50; Emacs writes wrong glyph at the bottom-right corner of text terminals

From: Gregory Heytings <[email-masked]>
Date: Mon, 12 Sep 2022 12:07:12 +0000

>> 1. emacs -Q -nw
>>
>> 2a. if your terminal emulator has a light background: M-x load-theme 
>> RET modus-vivendi RET
>>
>> 2b. if your terminal emulator has a dark background: M-x load-theme RET 
>> modus-operandi RET
>
> These do nothing in my case,
>

What terminal do you use?

>
> but I don't think that's crucial.
>

It's not crucial, but it shows that Emacs doesn't write there, and it 
makes the bug more apparent later.

>> Observe at that point that the last character (the one at the bottom 
>> right) does not have the background color of the chosen theme.  So far 
>> so good.
>
> Doesn't happen here (and why "good"?).
>

That everything works as expected: the last character at the bottom right 
is not touched.

>> 5. Now hit C-p a few times, until you see the "\" continuation 
>> character appear on the last character (the one at the bottom right). 
>> This should not happen.
>
> It does happen.  Why do you think it shouldn't?  Those are all continued 
> lines, so they should all end with a '\'.
>

Because Emacs should never write on the last character at the bottom 
right.

>
> However, if I now C-n enough times to have the mini-window scroll, I see 
> that lines scrolled into the view don't have the '\' continuation glyph. 
> _That_ shouldn't happen.  So I finally have something to work with, 
> thanks.
>

That shouldn't happen either, indeed.  But that wasn't what the bug report 
originally said.

>> (Note that the "\" continuation character disappears with C-l, after 
>> step 5 and after step 6.)
>
> Yes, because C-l redraws TTY frames.
>

Yes, I know 😉 It was just a way to make it clearer that there's a bug: 
when the frame is redrawn, the last character at the bottom right is 
cleared.