all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* ";0c" in terminal with slow connections
@ 2007-09-03 10:57 Vincent Lefevre
  2007-09-04 16:45 ` Richard Stallman
  0 siblings, 1 reply; 18+ messages in thread
From: Vincent Lefevre @ 2007-09-03 10:57 UTC (permalink / raw)
  To: bug-gnu-emacs

I have the following problem with the recent snapshot emacs versions
on Debian (at least in the emacs-snapshot 20070824-1 Debian package).

When I connect by ssh via an ADSL connection, I get some characters
(see explanation below) in the Emacs buffer just after starting Emacs
(running in the current terminal, i.e. not with its graphic interface).
This is almost 100% reproducible under these conditions. But this bug
doesn't occur with fast ssh connections. I suppose that Emacs does some
flushing, but it probably occurs too early with an ADSL connection, due
to a higher latency.

Also note that the bug doesn't occur with Emacs22 on the same machine
(I first thought it could be a bug in the ncurses library, but this
doesn't seem so).

The characters that appear in the buffer are those coming from the
"Send Device Attributes". I analyzed the terminal logs and could see
that Emacs sent the following sequences:

  home cnorm cvvis \E[60d el rmkx cnorm rmcup op ^M smcup cvvis smkx
  \E[>0c \E>4;1m \E[60;1H

The problem comes from the \E[>0c. /usr/share/doc/xterm/ctlseqs.txt.gz
(under Debian) says:

  CSI > Ps c
          Send Device Attributes (Secondary DA)
            Ps = 0  or omitted -> request the terminal's identification
          code.  The response depends on the decTerminalID resource set-
          ting.  It should apply only to VT220 and up, but xterm extends
          this to VT100.
            -> CSI  > Pp ; Pv ; Pc c
          where Pp denotes the terminal type
            -> 0  (``VT100'')
            -> 1  (``VT220'')
          and Pv is the firmware version (for xterm, this was originally
          the XFree86 patch number, starting with 95).  In a DEC termi-
          nal, Pc indicates the ROM cartridge registration number and is
          always zero.

Note that when ssh isn't used, this sequence is still sent by Emacs,
but I think that some flushing of the input takes care of this. From
a shell, you can type

  printf "\e[>0c"

to see the effect: characters are sent to the input and appears in the
command line.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2007-09-09 14:09 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-03 10:57 ";0c" in terminal with slow connections Vincent Lefevre
2007-09-04 16:45 ` Richard Stallman
2007-09-04 19:49   ` Stefan Monnier
2007-09-04 22:15     ` Vincent Lefevre
2007-09-05  6:16     ` Richard Stallman
2007-09-06  5:34       ` Dan Nicolaescu
2007-09-06 12:50         ` Vincent Lefevre
2007-09-06 15:28           ` Davis Herring
2007-09-07  6:32           ` Richard Stallman
2007-09-07  9:33             ` Vincent Lefevre
2007-09-07 14:13             ` Dan Nicolaescu
2007-09-08  7:00               ` Richard Stallman
2007-09-08  8:32                 ` Dan Nicolaescu
2007-09-08  8:21               ` Vincent Lefevre
2007-09-08  8:35                 ` Dan Nicolaescu
2007-09-08  9:32                   ` Vincent Lefevre
2007-09-08 16:17                     ` Dan Nicolaescu
2007-09-09 14:09                       ` Vincent Lefevre

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.