changeset 100259:fdc9da3de755

(terminal-init-xterm): Discard pending input before reading a reply to the terminal attributes query.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 06 Dec 2008 03:57:16 +0000
parents bf2416a86e50
children c663881a61c6
files lisp/term/xterm.el
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/term/xterm.el	Sat Dec 06 03:55:05 2008 +0000
+++ b/lisp/term/xterm.el	Sat Dec 06 03:57:16 2008 +0000
@@ -473,6 +473,9 @@
     (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")