[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#16656: [PATCH] Detect XTerm versions for non-VT100 emulation modes
From: |
W. Trevor King |
Subject: |
bug#16656: [PATCH] Detect XTerm versions for non-VT100 emulation modes |
Date: |
Wed, 5 Feb 2014 01:05:03 -0800 |
* term/xterm.el (xterm--version-handler): Handle cases where the
terminal type is not zero. The three numbers in the {CSI}>{Ps}c
response are: Pp (terminal type), Pv (firmware version), and Pc
(always zero for xterm). Before this commit, Emacs only looked at
Pv if Pp was zero (VT100). However, for XTerm v280 and later, the
default emulation is for VT420 (Pp = 41). See the XTerm changelog
for details:
http://invisible-island.net/xterm/xterm.log-contents.html#xterm_280
---
lisp/term/xterm.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 87f8c96..3d1b28b 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -500,8 +500,8 @@ The relevant features are:
;; see if by using a longer timeout we get rid of most issues.
(while (and (setq chr (read-event nil nil 2)) (not (equal chr ?c)))
(setq str (concat str (string chr))))
- (when (string-match "0;\\([0-9]+\\);0" str)
- (let ((version (string-to-number (match-string 1 str))))
+ (when (string-match "\\([0-9]+\\);\\([0-9]+\\);0" str)
+ (let ((version (string-to-number (match-string 2 str))))
;; If version is 242 or higher, assume the xterm supports
;; reporting the background color (TODO: maybe earlier
;; versions do too...)
--
1.8.5.2.8.g0f6c0d1