Subject: bug#14615: xterm--query results in slow -nw startup on some terminals

From: Glenn Morris <[email-masked]>
Date: Fri, 14 Jun 2013 03:38:41 -0400

echo -e "\e[>0c"
returns
^[[?1;2c  for aterm  (the Debian one runs fine for me and is also slow)
^[[>41;293;0c  for xterm
^[[>1;2802;0c  for xfce4-terminal

Here's the values of

  i (car handler) evt unread-command-events
followed by
  i (length (car handler)

for xterm / xfce4-terminal:

0 "^[[?" 27 nil
1 "^[[?" 91 nil
2 "^[[?" 62 nil
2 3
0 "^[[>" 27 (91 62)
1 "^[[>" 91 (62)
2 "^[[>" 62 nil
3 3

and for aterm

0 "^[[?" 27 nil
1 "^[[?" 91 nil
2 "^[[?" 63 nil
3 3
0 "^[[>" nil nil
0 3

So the xterm case has stuff pushed into unread-command-events by the
first handler, which is then there for the second handler to read.

aterm does not, so the second handler has nothing to read.

So I can make aterm fast, and xterm slow, by swapping the order of the 
 ("\e[?" . xterm--version-handler)
 ("\e[>" . xterm--version-handler)