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

From: Gregory Heytings <[email-masked]>
Date: Sun, 11 Sep 2022 20:35:47 +0000

>
> Thanks, but please provide more info:
>
> . the exact recipe to try (I tried to follow the above, but couldn't, I 
> guess I misunderstand what you mean)
>
> . on which terminal emulators this is known to happen, at least in your 
> case (and if you happen to know, also others)
>

Here is (I think) a recipe to demonstrate what the OP has in mind (tested 
with xterm, rxvt, st, kitty, alacritty, Linux console):

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

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.

3. M-: (define-key minibuffer-mode-map (kbd "C-t") (defun bug57728 () (interactive) (dotimes (i 5000) (insert (+ (% (random) 26) ?a))))) RET

4. M-: C-t

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.

6. Now press C-g.  The continuation character stays there.  Again this 
should not happen.

(Note that the "\" continuation character disappears with C-l, after step 
5 and after step 6.)