Subject: bug#78474: 31.0.50; Wrong char insertion in rxvt

From: Eli Zaretskii <[email-masked]>
Date: Sun, 18 May 2025 08:13:58 +0300

> Cc: Sébastien Hinderer <[email-masked]>,
>  Samuel Thibault <[email-masked]>
> From: Bastien Guerry <[email-masked]>
> Date: Sun, 18 May 2025 00:53:13 +0200
> 
> 
> With Emacs >= 24 in rxvt (not urxvt), steps to reproduce:
> 
> 1. find a new buffer and write "Coucou"
> 2. hit SPC
> 3. see the space inserted: it is too large.
> 
> https://dept-info.labri.fr/~thibault/tmp/coucou.png illustrates the bug.
> 
> Quoting Samuel: "Emacs, instead of sending a rightward cursor movement
> (\e[C), sends \009\008 (a tabulation and a leftward cursor movement)"
> 
> This char insertion problem confuses assistive technologies for the
> visually impaired.
> 
> Sebastien reported this problem and both Samuel and Sebastien might help
> with further information on how to reproduce this, if needed.

Emacs has code to estimate the cost of the various ways of getting the
same effect on a text-only terminal and choose the least expensive
one, see cm.c.  If some of the calculations there need to be augmented
to avoid confusing the technologies you mention, someone who knows
about those technologies should study the code and tell us how to
modify the calculations.  Then we could have those modifications
either optional (subject to some user option), or even unconditional.

If Sébastien or Samuel (or someone else) can help us understand how to
modify the cost calculations and/or what optimizations of cursor
motion to avoid when these technologies for the visually impaired are
used, we could see how to fix this.

Thanks.