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

From: Eli Zaretskii <[email-masked]>
Date: Sat, 02 Aug 2025 17:49:48 +0300

> From: Manuel Giraud <[email-masked]>
> Cc: Samuel Thibault <[email-masked]>,  Eli Zaretskii
>  <[email-masked]>,  [email-masked],  [email-masked],
>   [email-masked]
> Date: Sat, 02 Aug 2025 15:17:35 +0200
> 
> Robert Pluim <[email-masked]> writes:
> 
> >>>>>> On Fri, 25 Jul 2025 13:08:07 +0200, Manuel Giraud <[email-masked]> said:
> >
> >     Manuel> Samuel Thibault <[email-masked]> writes:
> >     Manuel> [...]
> >
> >     >>> Here are my results with this new benchmark:
> >     >> 
> >     >> (Several measurements are really needed because of variability)
> >
> >     Manuel> Why not.  So, here is the benchmark code I used:
> >
> > So it looks to me like not emitting \t\b is slightly faster. Could you
> > repost your patch with a user option to enable/disable it? Then we can
> > discuss what the default should be. Iʼm leaning towards the default
> > being not emitting it, since the resulting redisplay will be correct
> > in any case.
> 
> Hi Robert and all,
> 
> Here it is.  I'm not quite sure about the user option name, its
> documentation and NEWS entry.  Samuel could you test if this new default
> works for screen readers and also if setting
> `inhibit-overshoot-in-tty-motions' to nil make them unwork.

Thanks, a few minor comments below.

> +---
> +** New user option 'inhibit-overshoot-in-tty-motions'.

I see no reason to make this a user option.  It should be a simple
variable.  Also, I'd call it tty-cursor-movement-use-TAB-BS and set it
to nil by default.

> +The display optimization where the combination TAB characters +
> +BACKSPACE to move to a position on a TTY frame is now disabled by
> +default and controlled by this user option.  This option can be set
> +customized to nil to keep the old behavior.  This is to accomodate to
> +some software such as screen readers.

This is a somewhat incompatible change.  So this NEWS text should be
in the "Incompatible changes" section.

I also think lisp/term/rxvt.el should force this variable to avoid
TAB+BS, since rxvt is known to produce buggy behavior with that
combination.

Otherwise, this should be good to go.