From unknown Wed Jun 25 05:43:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43891: 26.3; Wrong background-mode on gnome-terminal 3.38 Resent-From: semente Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Oct 2020 21:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43891 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 43891@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16022790456405 (code B ref -1); Fri, 09 Oct 2020 21:31:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 Oct 2020 21:30:45 +0000 Received: from localhost ([127.0.0.1]:36438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQzyP-0001fF-54 for submit@debbugs.gnu.org; Fri, 09 Oct 2020 17:30:45 -0400 Received: from lists.gnu.org ([209.51.188.17]:49642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQzyL-0001f3-Cv for submit@debbugs.gnu.org; Fri, 09 Oct 2020 17:30:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQzyK-0004wW-8j for bug-gnu-emacs@gnu.org; Fri, 09 Oct 2020 17:30:40 -0400 Received: from mx1.riseup.net ([198.252.153.129]:34450) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQzyH-0000RH-W4 for bug-gnu-emacs@gnu.org; Fri, 09 Oct 2020 17:30:39 -0400 Received: from bell.riseup.net (bell-pn.riseup.net [10.0.1.178]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4C7Lp106FszFt7Z for ; Fri, 9 Oct 2020 14:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1602279028; bh=f23aicOX/wEj0+IC4A5fu7VCsPDpC4BKGzyc+BRXdwU=; h=From:To:Subject:Date:From; b=KzAqMaTLWPoWZBaLvUkxLBYpVvcDrxr9+ZhthzdP5Afx2S7h8s1EAyYiLWEeCBKYP 5JBeKEqXcNT3wlVC9KoMqKMm3lohARj0NCL33vm5oomxl0Snbe/0+7v1Is5SdeTe9I aQUnuCEUQYzN0ANTEcUPg+GF8OFb1tBe/2B+AFW8= X-Riseup-User-ID: 40C5D934C25925426C261C8490BE13AE33B107AA879C0E7365FEF441D64ABC96 Received: from [127.0.0.1] (localhost [127.0.0.1]) by bell.riseup.net (Postfix) with ESMTPSA id 4C7Lnz5gqlzJnxr for ; Fri, 9 Oct 2020 14:30:10 -0700 (PDT) From: semente Date: Fri, 09 Oct 2020 18:30:00 -0300 Message-ID: <875z7j9jfr.fsf@p50> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Received-SPF: pass client-ip=198.252.153.129; envelope-from=semente@riseup.net; helo=mx1.riseup.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/09 17:30:31 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) On gnome-terminal 3.38 (and possibly on 3.36, 3.34 and future versions as well) Emacs is setting the background-mode to light while I'm running a dark background. On xterm or ttys it works fine. The following snippet fix this issue: (setq frame-background-mode 'dark) (set-background-color "black") (set-foreground-color "white") 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. Thank you! semente [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=%2329716 In GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20) of 2020-05-16, modified by Debian built on x86-csail-01 Windowing system distributor 'The X.Org Foundation', version 11.0.12009000 System Description: Debian GNU/Linux bullseye/sid Configured using: 'configure --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.3/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.3/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/emacs-mHAik2/emacs-26.3+1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LIBSYSTEMD LCMS2 Important settings: value of $LC_MONETARY: pt_BR.UTF-8 value of $LC_NUMERIC: pt_BR.UTF-8 value of $LC_TIME: pt_BR.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix From unknown Wed Jun 25 05:43:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43891: 26.3; Wrong background-mode on gnome-terminal 3.38 Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Oct 2020 15:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43891 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: semente Cc: 43891@debbugs.gnu.org, Noam Postavsky Received: via spool by 43891-submit@debbugs.gnu.org id=B43891.160277569727490 (code B ref 43891); Thu, 15 Oct 2020 15:29:01 +0000 Received: (at 43891) by debbugs.gnu.org; 15 Oct 2020 15:28:17 +0000 Received: from localhost ([127.0.0.1]:56242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kT5Au-00079J-J3 for submit@debbugs.gnu.org; Thu, 15 Oct 2020 11:28:17 -0400 Received: from quimby.gnus.org ([95.216.78.240]:44370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kT5As-000795-Jd for 43891@debbugs.gnu.org; Thu, 15 Oct 2020 11:28:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=oWyNPgY+r2tUAUteiG8e3qNSihkn98g34op2h2sJGIk=; b=N4K0NP01WdHL1y/y5hEKNaQ3Od dV5s20UFbHlQBvQz+KoqGknZ50QOBgAoLxHiZdtBmSOhVuYz6yyRv08snhU0gpcGqnE0lVhhvzl/m X+WOkPpjpr1ARxgSeD160qEGeisvxf+OkH4OlXqr5Fmonwbbx2UB4sdP9Kx4HKAvHlnI=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kT5Ab-0005lL-Kr; Thu, 15 Oct 2020 17:28:08 +0200 From: Lars Ingebrigtsen References: <875z7j9jfr.fsf@p50> X-Now-Playing: Oval's _Popp_: "lo" Date: Thu, 15 Oct 2020 17:27:55 +0200 In-Reply-To: <875z7j9jfr.fsf@p50> (semente@riseup.net's message of "Fri, 09 Oct 2020 18:30:00 -0300") Message-ID: <87r1pzv79g.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: semente 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 f [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) semente 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 From unknown Wed Jun 25 05:43:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43891: 26.3; Wrong background-mode on gnome-terminal 3.38 Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Dec 2020 03:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43891 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: semente Cc: 43891@debbugs.gnu.org, Noam Postavsky Received: via spool by 43891-submit@debbugs.gnu.org id=B43891.160912504624433 (code B ref 43891); Mon, 28 Dec 2020 03:11:01 +0000 Received: (at 43891) by debbugs.gnu.org; 28 Dec 2020 03:10:46 +0000 Received: from localhost ([127.0.0.1]:33967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktivm-0006M1-Ah for submit@debbugs.gnu.org; Sun, 27 Dec 2020 22:10:46 -0500 Received: from quimby.gnus.org ([95.216.78.240]:38720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktivk-0006Lg-9E for 43891@debbugs.gnu.org; Sun, 27 Dec 2020 22:10:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=9YPeUjkk1eCPM55+MpZVXRhGd/S6mrhy6zYLUzf/wig=; b=O7twcdFJezGb3128xANJqGU3Rq TufOul9kYCL92wvJRAwThsWuwp++xs9oAdgwMsx+fwnNdqgrpfh6yKVx2+QrBeqbIwi7v6Y5bVJNQ BmpCT0t2wjjDboGc7/QaGvRTrfCFIJxnmLLpfN4byi+D4Or0LA71LE3r7bz9kP/RF9n0=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ktivY-0007pq-BR; Mon, 28 Dec 2020 04:10:37 +0100 From: Lars Ingebrigtsen References: <875z7j9jfr.fsf@p50> <87r1pzv79g.fsf@gnus.org> X-Now-Playing: The Clash's _Sandinista!_: "Lose This Skin" Date: Mon, 28 Dec 2020 04:10:31 +0100 In-Reply-To: <87r1pzv79g.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 15 Oct 2020 17:27:55 +0200") Message-ID: <87zh1y39so.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen 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 definetel [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen 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? Nobody had an opinion here, so I pushed this to the trunk now. It seems to fix the problem, and should probably not regress anything. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 27 22:10:52 2020 Received: (at control) by debbugs.gnu.org; 28 Dec 2020 03:10:52 +0000 Received: from localhost ([127.0.0.1]:33972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktivs-0006MP-JM for submit@debbugs.gnu.org; Sun, 27 Dec 2020 22:10:52 -0500 Received: from quimby.gnus.org ([95.216.78.240]:38734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktivq-0006Lx-KU for control@debbugs.gnu.org; Sun, 27 Dec 2020 22:10:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=eMozt81183JbVIdRh3paqdFrRiqTLMyJ0oNBemp3EVc=; b=m9LYFdbQUzPUzHgZ6oV+6GCUR1 xgJ19CCHAzHGAC+Q4MiMM2Oi+nr+gvvOeZjl6up4WUAvR0IDhzWBdwY28ajiHUkznKxg1cMFQzRaS zMSro654LAvpwvg5TfbEVRKqeov8UcIIJa11275WfS7R8AZwTmV73g7kM17YVnre73Fs=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ktivj-0007py-6j for control@debbugs.gnu.org; Mon, 28 Dec 2020 04:10:45 +0100 Date: Mon, 28 Dec 2020 04:10:42 +0100 Message-Id: <87y2hi39sd.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #43891 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 43891 fixed close 43891 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 43891 fixed close 43891 28.1 quit