GNU bug report logs - #16988
24.3.50; emacs -nw -Q --eval '(kill-emacs)' takes 2 seconds unless I hit a key

Previous Next

Package: emacs;

Reported by: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>

Date: Tue, 11 Mar 2014 15:24:01 UTC

Severity: important

Found in version 24.3.50

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

Full log


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

From: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 16988 <at> debbugs.gnu.org
Subject: Re: bug#16988: 24.3.50;
 emacs -nw -Q --eval '(kill-emacs)' takes 2 seconds unless I hit a key
Date: Wed, 26 Mar 2014 11:29:11 +0100
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:
>> With latest trunk:
>> $ time src/emacs -nw -Q --eval '(kill-emacs)'
>> real	0m2.064s
>> user	0m0.030s
>> sys	0m0.010s
>> If however I hit a key, emacs exits immediately.
>
> The patch below works for me, but I'm not sure if the terminal type and
> version returned by gnome-terminal is "stable" or not.
> Can you confirm it fixes your problem as well?

Here's a patch based on COLORTERM which works for me.

diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index eac4014..bd5675b 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -503,6 +503,12 @@ The relevant features are:
     ;; Since xterm-280, the terminal type (NUMBER1) is now 41 instead of 0.
     (when (string-match "\\([0-9]+\\);\\([0-9]+\\);0" str)
       (let ((version (string-to-number (match-string 2 str))))
+        ;; gnome-terminal pretends to be xterm but lacks some of its
+        ;; more recent features.  See bug#16988.
+        (let ((colorterm (getenv "COLORTERM" (selected-frame))))
+          (when (and colorterm
+                     (string-match "\\`gnome-terminal" colorterm))
+            (setq version 200)))
         ;; If version is 242 or higher, assume the xterm supports
         ;; reporting the background color (TODO: maybe earlier
         ;; versions do too...)

--
Nico.




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

Previous Next


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