unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "W. Trevor King" <wking@tremily.us>
To: 16657@debbugs.gnu.org
Cc: "W. Trevor King" <wking@tremily.us>
Subject: bug#16657: [PATCH] Detect XTerm versions for non-VT100 emulation modes
Date: Wed,  5 Feb 2014 08:47:39 -0800	[thread overview]
Message-ID: <01e801b917954436b4bc557f78356975ae9c38f8.1391591023.git.wking@tremily.us> (raw)
In-Reply-To: <01e801b917954436b4bc557f78356975ae9c38f8.1391591022.git.wking@tremily.us>

* 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
---
I sent this in a few hours ago, but it doesn't look like it made it to
the list.  I wasn't subscribed to the list then, so it's possible the
original is queued for moderator approval.  I didn't get any message
to that effect though, so I just signed up and am sending this
resubmission ;).

Another useful link (the source for my control code information) is
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html, but I didn't
work that into my commit message.  Let me know if that's worth a
resubmit.

Cheers,
Trevor

 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






  reply	other threads:[~2014-02-05 16:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05  9:05 bug#16656: [PATCH] Detect XTerm versions for non-VT100 emulation modes W. Trevor King
2014-02-05 16:47 ` W. Trevor King [this message]
2014-02-05 21:40   ` bug#16657: " Glenn Morris
2014-02-06 16:24     ` W. Trevor King
2014-02-07  3:39       ` Glenn Morris
2014-02-07  5:20         ` W. Trevor King
2014-02-06 20:22     ` W. Trevor King
2014-02-19 19:17   ` W. Trevor King
2014-02-19 19:58     ` Stefan Monnier
2014-02-20  4:45   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01e801b917954436b4bc557f78356975ae9c38f8.1391591023.git.wking@tremily.us \
    --to=wking@tremily.us \
    --cc=16657@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).