# HG changeset patch # User Chong Yidong # Date 1228535836 0 # Node ID fdc9da3de755898e8b4097399f75a1f2dd89381e # Parent bf2416a86e503bc7b79c0b2421c59ddc8a84485b (terminal-init-xterm): Discard pending input before reading a reply to the terminal attributes query. diff -r bf2416a86e50 -r fdc9da3de755 lisp/term/xterm.el --- 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")