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

From: Samuel Thibault <[email-masked]>
Date: Sun, 18 May 2025 11:26:03 +0200

Hello,

Bastien Guerry, le dim. 18 mai 2025 10:54:50 +0200, a ecrit:
> Samuel Thibault <[email-masked]> writes:
> 
> > "Emacs, instead of sending a rightward cursor movement
> > (\e[C), sends \009\008 (a tabulation and a leftward cursor movement)"
> 
> I'd describe it as the result of the "optimization" rather than the
> optimization itself...
> 
> Line 90 of cm.c, there is this if clause that leads to a comment:
> 
> 	if (tty->Wcm->cm_magicwrap)
> 	    ;			/* "limbo" */

But this is only about the end of a line? We are not talking about the
end of a line here.

That said, that pointed me to the optimization code in calccost, which
looks at tty->Wcm->cm_usetabs to determine whether to use tabs or not,
which is set from tabs_safe_p and TabWidth. Apparently, using 

stty -tabs

does avoid the issue, by making rxvt & vte switch to destructive tabs,
which emacs then knows to avoid just for moving the cursor.

Samuel