From 657e833239de855e2153380bab1066586d023ae6 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Tue, 23 Oct 2007 14:24:43 +0000 Subject: (terminal-init-xterm): Experiment with a longer timeout. --- lisp/term/xterm.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lisp/term/xterm.el') diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index a60aa90255f..fbc4c861bf9 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -480,9 +480,14 @@ (send-string-to-terminal "\e[>0c") ;; The reply should be of the form: \e [ > NUMBER1 ; NUMBER2 ; NUMBER3 c - (when (equal (read-event nil nil 0.1) ?\e) - (when (equal (read-event nil nil 0.1) ?\[) - (while (not (equal (setq chr (read-event nil nil 0.1)) ?c)) + ;; If the timeout is completely removed for read-event, this + ;; might hang for terminals that pretend to be xterm, but don't + ;; respond to this escape sequence. RMS' opinion was to remove + ;; it completely. That might be right, but let's first try to + ;; see if by using a longer timeout we get rid of most issues. + (when (equal (read-event nil nil 2) ?\e) + (when (equal (read-event nil nil 2) ?\[) + (while (not (equal (setq chr (read-event nil nil 2)) ?c)) (setq str (concat str (string chr)))) (when (string-match ">0;\\([0-9]+\\);0" str) ;; NUMBER2 is the xterm version number, look for something -- cgit v1.2.1