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

From: Robert Pluim <[email-masked]>
Date: Wed, 16 Jul 2025 17:43:49 +0200

>>>>> On Fri, 11 Jul 2025 22:06:25 +0300, Eli Zaretskii <[email-masked]> said:

    >> From: Robert Pluim <[email-masked]>
    >> Cc: Samuel Thibault <[email-masked]>,  [email-masked],  Eli
    >> Zaretskii <[email-masked]>,  [email-masked]
    >> Date: Fri, 11 Jul 2025 19:32:43 +0200
    >> 
    >> >>>>> On Fri, 11 Jul 2025 17:20:52 +0200, Bastien Guerry <[email-masked]> said:
    >> 
    Bastien> Is there anyone working on this?
    Bastien> It's beyond my skills, but I'd hate to see this bug closed due to lack
    Bastien> of activity/interest.  Let me know if I can help somehow.
    >> 
    >> I can take a look at it. Eli, a clue as to where this optimization
    >> happens in the redisplay code?

    Eli> I mentioned that up-thread: it's in cm.c.

Thanks, Iʼd missed that.

cm.c works out the cost of either

- moving past the destination with tabs then moving left
- moving towards the destination with tabs then moving right
- moving right directly to the destination

According to my instrumentation, emitting the 'move right' command
costs 3 times as much as 'emit tab' or 'move left' here, so itʼs an
optimization that makes sense, especially if the destination is far
away.

So I donʼt think a generic 'make tabs expensive' is a good idea, but I
guess we could add a user option to disable the use of tabs for motion
on ttys.

Robert
--