]> code.delx.au - gnu-emacs/commitdiff
(terminal-init-xterm): Discard pending input before reading a reply to
authorChong Yidong <cyd@stupidchicken.com>
Sat, 6 Dec 2008 03:57:16 +0000 (03:57 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Sat, 6 Dec 2008 03:57:16 +0000 (03:57 +0000)
the terminal attributes query.

lisp/term/xterm.el

index b01adf4995b69e417861fe318fa453dca6aeda39..e893f88da50459df18aeaa325e0b0f21f4c88495 100644 (file)
     (let ((coding-system-for-read 'binary)
          (chr nil)
          (str nil))
+      ;; Pending input can be mistakenly returned by the calls to
+      ;; read-event below.  Discard it.
+      (discard-input)
       ;; Try to find out the type of terminal by sending a "Secondary
       ;; Device Attributes (DA)" query.
       (send-string-to-terminal "\e[>0c")