Subject: Re: bug#7512: 24.0.50; emacs -Q -nw -eval '(view-lossage)' shows phantom chars under xterm

From: Eli Zaretskii <[email-masked]>
Date: Sun, 03 Jul 2011 02:22:25 -0400

> From: Lars Magne Ingebrigtsen <[email-masked]>
> Date: Sat, 02 Jul 2011 23:28:33 +0200
> Cc: [email-masked], [email-masked]
> 
> [email-masked] writes:
> 
> > No big deal, but
> > $ emacs -Q -nw -eval '(view-lossage)'
> > shows
> > ESC [ > 0 ; 2 6 6 ; 0 c ESC ] 1 1 ; r g b : 0 0 0 0
> > / 0 0 0 0 / 0 0 0 0 ESC \
> > when run in xterm. I did not type that.
> 
> I can confirm this in a "C" locale, too:
> 
> ESC [ > 0 ; 2 6 1 ; 0 c ESC ] 1 1 ; r g b : 0 0 0 0
> / 0 0 0 0 / 0 0 0 0 ESC \ d s d s RET ESC x ESC p ESC
> x v i e w - l o s TAB RET
> 
> Are those escape codes registered as typed keystrokes?

See xterm.el:terminal-init-xterm, search for send-string-to-terminal.
In a nutshell, we send special commands to the terminal to find out
about its capabilities.