# HG changeset patch # User Dan Nicolaescu # Date 1193149483 0 # Node ID fbdae6f74bf5a3aab4f2b9aaa94b77cf4972cdd7 # Parent 923d7a3f8eed08671363a5d2d6e3a3c702b6434e (terminal-init-xterm): Experiment with a longer timeout. diff -r 923d7a3f8eed -r fbdae6f74bf5 lisp/ChangeLog --- a/lisp/ChangeLog Tue Oct 23 08:42:39 2007 +0000 +++ b/lisp/ChangeLog Tue Oct 23 14:24:43 2007 +0000 @@ -1,3 +1,8 @@ +2007-10-23 Dan Nicolaescu + + * term/xterm.el (terminal-init-xterm): Experiment with a longer + timeout. + 2007-10-23 Katsumi Yamaoka * emacs-lisp/advice.el (ad-make-advised-docstring): diff -r 923d7a3f8eed -r fbdae6f74bf5 lisp/term/xterm.el --- a/lisp/term/xterm.el Tue Oct 23 08:42:39 2007 +0000 +++ b/lisp/term/xterm.el Tue Oct 23 14:24:43 2007 +0000 @@ -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