From: Chong Yidong Date: Sat, 6 Dec 2008 03:57:16 +0000 (+0000) Subject: (terminal-init-xterm): Discard pending input before reading a reply to X-Git-Tag: emacs-pretest-23.0.90~1239 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=56f37e53c9713f1ff3823bfd649cf2c9827d6068;p=emacs.git (terminal-init-xterm): Discard pending input before reading a reply to the terminal attributes query. --- diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index b01adf4995b..e893f88da50 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -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")