From: Noam Postavsky <npostavs@users.sourceforge.net>
To: semente <semente@riseup.net>
Cc: 29716@debbugs.gnu.org
Subject: bug#29716: 25.1; Wrong brackground-mode on gnome-terminal
Date: Thu, 14 Dec 2017 21:47:45 -0500 [thread overview]
Message-ID: <87y3m4btbi.fsf@users.sourceforge.net> (raw)
In-Reply-To: <87shcd56jv.fsf@cafe.lan> (semente's message of "Thu, 14 Dec 2017 19:43:48 -0200")
[-- Attachment #1: Type: text/plain, Size: 1479 bytes --]
tags 29716 + patch
quit
semente <semente@riseup.net> writes:
> On gnome-terminal 3.22.2 (Debian Stretch), for some reason, Emacs is
> setting the background-mode to light when I'm running a dark
> background. On xterm or ttys it works fine.
> $ printf '\e[>0c'
> 1;4601;0c
>
> $ printf '\e]11;?\e\'
> 11;rgb:2323/2727/2929
>
> $ echo $TERM
> xterm-256color
I think the attached should do the trick then. There are two other
xterm features that Emacs tries to use based on version number; I'm not
sure how to test if your version of gnome-terminal supports them or not
though (so I played it safe in the patch and use the query background
feature only).
(defun xterm--version-handler ()
...
;; If version is 216 (the version when modifyOtherKeys was
;; introduced) or higher, initialize the
;; modifyOtherKeys support.
(when (>= version 216)
(xterm--init-modify-other-keys))
;; In version 203 support for accessing the X selection was
;; added. Hterm reports itself as version 256 and supports it
;; as well. gnome-terminal doesn't and is excluded by this
;; test.
(when (>= version 203)
;; Most xterms seem to have it disabled by default, and if it's
;; disabled, C-y will incur a timeout, so we only use it if the user
;; explicitly requests it.
;;(xterm--init-activate-get-selection)
(xterm--init-activate-set-selection))...)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1552 bytes --]
From 34b6835f7581fb19f67fe134eab0b536af003dfa Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Thu, 14 Dec 2017 21:42:56 -0500
Subject: [PATCH v1] Query background for gnome terminal version 3.22
(Bug#29716)
* lisp/term/xterm.el (xterm--version-handler): Use
xterm--report-background-handler for terminals reporting minor version
4000 and above.
---
lisp/term/xterm.el | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 4f79703833..df224757f9 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -670,9 +670,14 @@ xterm--version-handler
(when (and (> version 2000) (equal (match-string 1 str) "1"))
;; Hack attack! bug#16988: gnome-terminal reports "1;NNNN;0"
;; with a large NNNN but is based on a rather old xterm code.
- ;; Gnome terminal 3.6.1 reports 1;3406;0
;; Gnome terminal 2.32.1 reports 1;2802;0
- (setq version 200))
+ ;; Gnome terminal 3.6.1 reports 1;3406;0
+ (setq version 200)
+ ;; Gnome terminal 3.22.2 reports 1;4601;0 and *does* support
+ ;; background color querying (Bug#29716).
+ (when (> version 4000)
+ (xterm--query "\e]11;?\e\\"
+ '(("\e]11;" . xterm--report-background-handler)))))
(when (equal (match-string 1 str) "83")
;; `screen' (which returns 83;40003;0) seems to also lack support for
;; some of these (bug#17607, bug#20356).
--
2.11.0
next prev parent reply other threads:[~2017-12-15 2:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-14 21:43 bug#29716: 25.1; Wrong brackground-mode on gnome-terminal semente
2017-12-15 1:13 ` Noam Postavsky
2017-12-15 1:44 ` semente
2017-12-15 2:47 ` Noam Postavsky [this message]
2017-12-15 8:52 ` Eli Zaretskii
2017-12-25 18:27 ` semente
2018-01-01 1:19 ` Noam Postavsky
2018-01-07 23:24 ` semente
2018-01-08 1:30 ` Noam Postavsky
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=87y3m4btbi.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=29716@debbugs.gnu.org \
--cc=semente@riseup.net \
/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).