From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "W. Trevor King" Newsgroups: gmane.emacs.bugs Subject: bug#16656: [PATCH] Detect XTerm versions for non-VT100 emulation modes Date: Wed, 5 Feb 2014 01:05:03 -0800 Message-ID: <01e801b917954436b4bc557f78356975ae9c38f8.1391591022.git.wking@tremily.us> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1391619019 3118 80.91.229.3 (5 Feb 2014 16:50:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Feb 2014 16:50:19 +0000 (UTC) Cc: "W. Trevor King" To: 16656@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 05 17:50:26 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WB5g9-0004hv-3T for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Feb 2014 17:50:25 +0100 Original-Received: from localhost ([::1]:60158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WB5g8-0003eG-IX for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Feb 2014 11:50:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WB5g0-0003e8-2D for bug-gnu-emacs@gnu.org; Wed, 05 Feb 2014 11:50:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WB5fn-00088o-BW for bug-gnu-emacs@gnu.org; Wed, 05 Feb 2014 11:50:16 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WB5fn-00088d-73 for bug-gnu-emacs@gnu.org; Wed, 05 Feb 2014 11:50:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WB5fm-0001um-FV for bug-gnu-emacs@gnu.org; Wed, 05 Feb 2014 11:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "W. Trevor King" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Feb 2014 16:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16656 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13916189587282 (code B ref -1); Wed, 05 Feb 2014 16:50:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Feb 2014 16:49:18 +0000 Original-Received: from localhost ([127.0.0.1]:51099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WB5f4-0001tN-33 for submit@debbugs.gnu.org; Wed, 05 Feb 2014 11:49:18 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43889) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WAyRB-0005jp-MA for submit@debbugs.gnu.org; Wed, 05 Feb 2014 04:06:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAyR4-0004u5-SJ for submit@debbugs.gnu.org; Wed, 05 Feb 2014 04:06:29 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:54922) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAyR4-0004u1-PB for submit@debbugs.gnu.org; Wed, 05 Feb 2014 04:06:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAyQy-0001dC-6N for bug-gnu-emacs@gnu.org; Wed, 05 Feb 2014 04:06:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAyQr-0004sB-KY for bug-gnu-emacs@gnu.org; Wed, 05 Feb 2014 04:06:16 -0500 Original-Received: from qmta05.westchester.pa.mail.comcast.net ([2001:558:fe14:43:76:96:62:48]:35891) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAyQr-0004rx-Du for bug-gnu-emacs@gnu.org; Wed, 05 Feb 2014 04:06:09 -0500 Original-Received: from omta07.westchester.pa.mail.comcast.net ([76.96.62.59]) by qmta05.westchester.pa.mail.comcast.net with comcast id NZ4l1n0031GhbT855Z68Th; Wed, 05 Feb 2014 09:06:08 +0000 Original-Received: from odin.tremily.us ([24.18.63.50]) by omta07.westchester.pa.mail.comcast.net with comcast id NZ661n00B152l3L3TZ67Uv; Wed, 05 Feb 2014 09:06:07 +0000 Original-Received: from mjolnir.tremily.us (unknown [192.168.0.140]) by odin.tremily.us (Postfix) with ESMTPS id CC3CEFE86C2; Wed, 5 Feb 2014 01:06:05 -0800 (PST) Original-Received: (nullmailer pid 23877 invoked by uid 1000); Wed, 05 Feb 2014 09:05:06 -0000 X-Mailer: git-send-email 1.8.5.2.8.g0f6c0d1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1391591168; bh=8DJMfJzlcaMsiO1GlmECZTFsQVuhjvYfqavqRqFlK64=; h=Received:Received:Received:Received:From:To:Subject:Date: Message-Id; b=N+GDHjBhMZUbQNeZD+g+r+7pgdRlguuOOBFkW4Yb+Uzotq0CLl418O8BxVi2MPki8 1camUUa8zw4LmCazjDG56t3D4wB6cyyJAv+8qRbYu6oVg2M5ceJFV4DJkdHTa3M2SX 4jqR1oYmmke+Lgm0aK1/EPNT2D/bTmQMhBa1Cvsar/nGOKUNzdckPzJYzM7DKtnzFn XrcNdWGTyY1jkmbCcYRk/UbuYLtcMvYJJ5OOSj27VKIITzITbQ1XtSwjL2/oWq51tx FutaoFBqex9rpKjTqQ+6VCgBXarq1OEo+KrjGVRF3q/XhJEUXKfCBXsfSekJWh4xK+ 9bu2lHzf1N0TQ== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Wed, 05 Feb 2014 11:49:16 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:84633 Archived-At: * 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