From 56f37e53c9713f1ff3823bfd649cf2c9827d6068 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 6 Dec 2008 03:57:16 +0000 Subject: [PATCH] (terminal-init-xterm): Discard pending input before reading a reply to the terminal attributes query. --- lisp/term/xterm.el | 3 +++ 1 file changed, 3 insertions(+) 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") -- 2.39.2