GNU bug report logs - #16657
[PATCH] Detect XTerm versions for non-VT100 emulation modes

Previous Next

Package: emacs;

Reported by: "W. Trevor King" <wking <at> tremily.us>

Date: Wed, 5 Feb 2014 16:50:03 UTC

Severity: normal

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16657 in the body.
You can then email your comments to 16657 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16657; Package emacs. (Wed, 05 Feb 2014 16:50:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to "W. Trevor King" <wking <at> tremily.us>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 05 Feb 2014 16:50:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "W. Trevor King" <wking <at> tremily.us>
To: bug-gnu-emacs <at> gnu.org
Cc: "W. Trevor King" <wking <at> tremily.us>
Subject: [PATCH] Detect XTerm versions for non-VT100 emulation modes
Date: Wed,  5 Feb 2014 08:47:39 -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
---
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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16657; Package emacs. (Wed, 05 Feb 2014 21:41:01 GMT) Full text and rfc822 format available.

Message #8 received at 16657 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: "W. Trevor King" <wking <at> tremily.us>
Cc: 16657 <at> debbugs.gnu.org
Subject: Re: bug#16657: [PATCH] Detect XTerm versions for non-VT100 emulation
 modes
Date: Wed, 05 Feb 2014 16:40:24 -0500
"W. Trevor King" wrote:

> so it's possible the original is queued for moderator approval.

Exactly. (There is no need to subscribe just to post BTW.)

> I didn't get any message to that effect though, so I just signed up
> and am sending this resubmission ;).

A better procedure is just to wait a bit. We don't send out "your
message is held for moderation" notices, since most things that get held
for moderation are spam.

Anyway, I will delete

http://debbugs.gnu.org/16656

since it is a duplicate of this.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16657; Package emacs. (Thu, 06 Feb 2014 16:25:01 GMT) Full text and rfc822 format available.

Message #11 received at 16657 <at> debbugs.gnu.org (full text, mbox):

From: "W. Trevor King" <wking <at> tremily.us>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 16657 <at> debbugs.gnu.org
Subject: Re: bug#16657: [PATCH] Detect XTerm versions for non-VT100 emulation
 modes
Date: Thu, 6 Feb 2014 08:24:45 -0800
[Message part 1 (text/plain, inline)]
On Wed, Feb 05, 2014 at 04:40:24PM -0500, Glenn Morris wrote:
> "W. Trevor King" wrote:
> > so it's possible the original is queued for moderator approval.
> 
> Exactly. (There is no need to subscribe just to post BTW.)

A note somewhere ([1], [2], or [3]?) that makes this explicit would be
nice.

> > I didn't get any message to that effect though, so I just signed
> > up and am sending this resubmission ;).
> 
> A better procedure is just to wait a bit.

Sorry.  I was too excited at figuring out why my background-mode
wasn't dark :p.  I'll be more patient next time.

> Anyway, I will delete
> 
> http://debbugs.gnu.org/16656
> 
> since it is a duplicate of this.

Thanks,
Trevor

[1]: https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs
[2]: http://www.gnu.org/software/emacs/manual/html_node/emacs/Contributing.html
[3]: http://www.gnu.org/software/emacs/CONTRIBUTE

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16657; Package emacs. (Thu, 06 Feb 2014 20:23:02 GMT) Full text and rfc822 format available.

Message #14 received at 16657 <at> debbugs.gnu.org (full text, mbox):

From: "W. Trevor King" <wking <at> tremily.us>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 16657 <at> debbugs.gnu.org
Subject: Re: bug#16657: [PATCH] Detect XTerm versions for non-VT100 emulation
 modes
Date: Thu, 6 Feb 2014 12:22:13 -0800
[Message part 1 (text/plain, inline)]
This issue is also mentioned in some of the comments from the tail of
#13839 [1,2,3].  Victor even quoted the XTerm changelog :p.  I don't
see a patch for this particular issue in #13839, although Stefan posts
a patch for some other keymap stuff, and Victor floats an alternate
regexp [1].

[1]: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13839#11
[2]: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13839#14
[3]: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13839#17
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16657; Package emacs. (Fri, 07 Feb 2014 03:40:01 GMT) Full text and rfc822 format available.

Message #17 received at 16657 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: "W. Trevor King" <wking <at> tremily.us>
Cc: 16657 <at> debbugs.gnu.org
Subject: Re: bug#16657: [PATCH] Detect XTerm versions for non-VT100 emulation
 modes
Date: Thu, 06 Feb 2014 22:39:34 -0500
"W. Trevor King" wrote:

> A note somewhere ([1], [2], or [3]?) that makes this explicit would be
> nice.

What I am saying is common to basically every GNU mailing list.
Even if you subscribe, you still need to wait for moderation at least
the first time. I think/hope this is standard practice for all sane
public mailing lists. Ie, everybody except Debian's? ;)

FWIW, "Checklist for Bug Reports"

http://www.gnu.org/software/emacs/manual/html_node/emacs/Checklist.html

does say "Submissions are moderated, so there may be a delay before your
report appears."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16657; Package emacs. (Fri, 07 Feb 2014 05:21:02 GMT) Full text and rfc822 format available.

Message #20 received at 16657 <at> debbugs.gnu.org (full text, mbox):

From: "W. Trevor King" <wking <at> tremily.us>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 16657 <at> debbugs.gnu.org
Subject: Re: bug#16657: [PATCH] Detect XTerm versions for non-VT100 emulation
 modes
Date: Thu, 6 Feb 2014 21:20:44 -0800
[Message part 1 (text/plain, inline)]
On Thu, Feb 06, 2014 at 10:39:34PM -0500, Glenn Morris wrote:
> FWIW, "Checklist for Bug Reports"
> 
> http://www.gnu.org/software/emacs/manual/html_node/emacs/Checklist.html
> 
> does say "Submissions are moderated, so there may be a delay before your
> report appears."

Ah, it certainly does.  Sorry I missed that.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16657; Package emacs. (Wed, 19 Feb 2014 19:18:03 GMT) Full text and rfc822 format available.

Message #23 received at 16657 <at> debbugs.gnu.org (full text, mbox):

From: "W. Trevor King" <wking <at> tremily.us>
To: 16657 <at> debbugs.gnu.org
Subject: Re: bug#16657: [PATCH] Detect XTerm versions for non-VT100 emulation
 modes
Date: Wed, 19 Feb 2014 11:17:23 -0800
[Message part 1 (text/plain, inline)]
Is there anything I can do to help this along?  I'm happy to add
clarifying information to the commit message if that would help.  In
13839, Stefan expressed concern over non-XTerms that claim to be XTerm
[1]:

On Mon, Mar 11, 2013 at 14:25:30 -0400, Stefan Monnier wrote:
> More specifically, I'm concerned that by accepting any "P p" number,
> we might end up trying to use a feature that's not supported by the
> underlying terminal emulator because it happens to have version
> numbers that are higher than those of "the usual xterm".

Lacking a spec for XTerm impersonators, it's hard to address this
directly.  However, as it stands, version detection is broken for
XTerm ≥ v280, and I think that fixing that known breakage for the true
XTerm is more important than avoiding hypothetical breakage for
impersonators.  Are there other concerns with the logic here?  If so,
what sort of research might help clear them up?  Are there some common
impersonators that I should investigate directly?

Cheers,
Trevor

[1]: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13839#14

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16657; Package emacs. (Wed, 19 Feb 2014 19:59:01 GMT) Full text and rfc822 format available.

Message #26 received at 16657 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "W. Trevor King" <wking <at> tremily.us>
Cc: 16657 <at> debbugs.gnu.org
Subject: Re: bug#16657: [PATCH] Detect XTerm versions for non-VT100 emulation
 modes
Date: Wed, 19 Feb 2014 14:58:51 -0500
> Is there anything I can do to help this along?

Do you have a few spare hours, maybe?


        Stefan




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Thu, 20 Feb 2014 04:47:01 GMT) Full text and rfc822 format available.

Notification sent to "W. Trevor King" <wking <at> tremily.us>:
bug acknowledged by developer. (Thu, 20 Feb 2014 04:47:02 GMT) Full text and rfc822 format available.

Message #31 received at 16657-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "W. Trevor King" <wking <at> tremily.us>
Cc: 16657-done <at> debbugs.gnu.org
Subject: Re: bug#16657: [PATCH] Detect XTerm versions for non-VT100 emulation
 modes
Date: Wed, 19 Feb 2014 23:45:55 -0500
> * 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

Thanks, I installed your patch.


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 20 Mar 2014 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 88 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.