Subject: Re: bug#23819: 25.0.95; display botched badly in xterm window

From: Paul Eggert <[email-masked]>
Date: Wed, 22 Jun 2016 20:55:57 +0200

On 06/22/2016 04:54 PM, Eli Zaretskii wrote:
>> From: Paul Eggert <[email-masked]>
>> Date: Wed, 22 Jun 2016 04:01:34 +0200
>>
>> This appears to be a relatively recent regression in the emacs-25
>> branch.
> How recent?  Can you estimate when this started to happen to you?  The
> relevant file (xterm.el) hasn't been touched in months, except by you,
> for the paste feature.

Sorry, my memory is inexact. I vaguely recall seeing a problem or two a 
couple of months ago. The problem has gotten worse recently, I expect 
partly because I am using lower-throughput and/or longer-latency ssh 
connections recently.

> The "ESC [ > 1;3201;0c" thingy is the response to query by 
> xterm--query, see xterm--version-handler. Is it true that all these 
> problems happen right in the beginning of a session? What happens if 
> you wait at least 2 sec after starting a session, without typing any 
> commands -- do these problems still happen?

I have observed the problem in later parts of a session. In particular, 
after a problem occurs and I type control-L to refresh the screen 
completely, I have observed the problem recur in the same Emacs session. 
Typically the problem occurs during interactive search, when substrings 
are being highlighted in the text and in the minibuffer. Typically I am 
searching code, where keywords and suchlike are also highlighted. I 
assume all this highlighting is being done in the background.

All this suggests that the issue is not limited to startup. Possibly 
there are two issues, one at startup and one later. For example, perhaps 
Emacs is deducing the incorrect terminal type during startup, or perhaps 
my (typically Ubuntu) clients are reporting an incorrect terminal type 
during startup.

> Your guess is probably right, except that I don't see any fiddling in 
> the Git log, certainly not recently. So if this indeed started 
> happening recently, there must be some other factor at work here. 

I agree.