unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: semente <semente@riseup.net>
Cc: 43891@debbugs.gnu.org, Noam Postavsky <npostavs@gmail.com>
Subject: bug#43891: 26.3; Wrong background-mode on gnome-terminal 3.38
Date: Thu, 15 Oct 2020 17:27:55 +0200	[thread overview]
Message-ID: <87r1pzv79g.fsf@gnus.org> (raw)
In-Reply-To: <875z7j9jfr.fsf@p50> (semente@riseup.net's message of "Fri, 09 Oct 2020 18:30:00 -0300")

semente <semente@riseup.net> writes:

> This is the same bug reported in #29716[1], which was fixed for
> gnome-terminal 3.22.  A solution made by Noam Postavsky is found on
> #29716 as well. Perhaps there is a way to fix this definetely for
> gnome-terminal, I believe it affects many users.

In gnome-terminal 3.38, the version string in xterm--version-handler is:

"65;6200;1"

So, just hacking blindly without any clue what this is, the following
patch fixes the issue for me.

Does anybody know whether this makes sense or not?

diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 1a727e3933..6f5fa7518b 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -710,15 +710,18 @@ xterm--version-handler
     (while (and (setq chr (xterm--read-event-for-query)) (not (equal chr ?c)))
       (setq str (concat str (string chr))))
     ;; Since xterm-280, the terminal type (NUMBER1) is now 41 instead of 0.
-    (when (string-match "\\([0-9]+\\);\\([0-9]+\\);0" str)
+    (when (string-match "\\([0-9]+\\);\\([0-9]+\\);[01]" str)
       (let ((version (string-to-number (match-string 2 str))))
-        (when (and (> version 2000) (equal (match-string 1 str) "1"))
+        (when (and (> version 2000)
+                   (or (equal (match-string 1 str) "1")
+                       (equal (match-string 1 str) "65")))
           ;; 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 2.32.1 reports 1;2802;0
           ;; Gnome terminal 3.6.1 reports 1;3406;0
           ;; Gnome terminal 3.22.2 reports 1;4601;0 and *does* support
           ;; background color querying (Bug#29716).
+          ;; Gnome terminal 3.38.0 reports 65;6200;1.
           (when (> version 4000)
             (xterm--query "\e]11;?\e\\"
                           '(("\e]11;" .  xterm--report-background-handler))))

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2020-10-15 15:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 21:30 bug#43891: 26.3; Wrong background-mode on gnome-terminal 3.38 semente
2020-10-15 15:27 ` Lars Ingebrigtsen [this message]
2020-12-28  3:10   ` Lars Ingebrigtsen

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=87r1pzv79g.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=43891@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    --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).