GNU bug report logs - #82128
32.0.50; 256-colour terminal can get a spurious grey background

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Sean Whitton <spwhitton@HIDDEN>; dated Wed, 28 Oct 2026 13:05:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 82128 <at> debbugs.gnu.org:


Received: (at 82128) by debbugs.gnu.org; 29 Oct 2026 11:22:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 29 07:22:52 2026
Received: from localhost ([127.0.0.1]:54639 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1xMODc-0000jm-F9
	for submit <at> debbugs.gnu.org; Thu, 29 Oct 2026 07:22:52 -0400
Received: from fhigh-a1-smtp.messagingengine.com ([103.168.172.152]:46041)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
 id 1xMODa-0000hY-9L
 for 82128 <at> debbugs.gnu.org; Thu, 29 Oct 2026 07:22:50 -0400
Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44])
 by mailfhigh.phl.internal (Postfix) with ESMTP id BB111140010B
 for <82128 <at> debbugs.gnu.org>; Thu, 29 Oct 2026 07:22:44 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
 by phl-compute-04.internal (MEProxy); Thu, 29 Oct 2026 07:22:44 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name;
 h=cc:cc:content-type:content-type:date:date:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:subject:subject:to:to; s=fm1; t=1793272964; x=
 1793359364; bh=KkxIA91cVBWRSJUw9O/2Tz9gzDq1Nh7vNjOtseIN/E0=; b=i
 8ccbHCpEXPQm6l5xNl08oz6ly/WKAHJRaXoMVYRHdu0vECxnSbXUMUb09fV03Vlp
 9cfFTkLnusQ8d+meJpid+27bNmUlLrabRglCN9FkEkX6TH6EAXzOnSZLQkgK28ly
 NVrbfWbt2/O2ZoA0THjvDvVjUmC5FV79Ef0HMw5/JE6zCA9A+9MSh3MH18N/WbAS
 NyuI/3nf4UaODmohxN4wBqoseAsdJ9IOdT0oCPqQ9Q7zlonZF/wSKaR8FjfCSR7s
 Cawg47QZ+KlXz3BDjPeBRqDHMmpJ3cQimkTTHpunjnHQjjHnIXWrwsnMibSfZzR/
 q5GfRXGvLR0P4GH/1nxEg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-type:content-type:date:date
 :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
 :message-id:mime-version:references:reply-to:subject:subject:to
 :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
 1793272964; x=1793359364; bh=KkxIA91cVBWRSJUw9O/2Tz9gzDq1Nh7vNjO
 tseIN/E0=; b=cb8OEFoRK6HKqyGvO18sAaEDdexge8fv8uLd4TAKMOPTGRs4YAP
 Yv41bcIwJ0kbe/7rBAiADZYTv3UXt95t4wxHJF5eeOWeKnNFfwtkgu7yu7hCGZBR
 cAR6wZcI0h5vQhSAGNAafZWpC2xOoG8XB6rCu+xw8yDJ4wSB2RnEbRnmZLv2a1Rf
 3w5DsRZVVJSJSIWz+hj+HvukkzRabmEDWHq5qp2FzSHOIapchl4rHfHdYelW0tQZ
 qFIism5PqO6J1ycEsKQFOrN+KoJMLOJ5PXvq5borK+EOS2H21FpJ3tMjqEGmTO3x
 PLGZ2WFORQMLnHwATmP1qQx0T4oT8PWnxkg==
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-08;
 repo=github.com/dkim2wg/interop; date=2026-10-28; sw=lmtpprox;
 action=sign d=spwhitton.name a=rsa-sha256;
DKIM2-Signature: i=1; m=1; t=1793272964; d=spwhitton.name;
 mf=PHNwd2hpdHRvbkBzcHdoaXR0b24ubmFtZT4=;
 rt=PDgyMTI4QGRlYmJ1Z3MuZ251Lm9yZz4=;
 s=fm1:rsa-sha256:fPgQQplHQUSC0Fr0Jzn/WQErZk+I6Af4QMnkl4GEJ7Na/tc
 BEKff+Hu9TkqtJQ8TW7XOOmsE5ZUvHvUUEMG4S/N6zMgh95QCTrsRAUQI5H+cnMB
 ykvrkn25Vj/pYFEdrT/3uc4Ry8ZEakpWEoFI2oJv8wff7PjMTmHmeVm/go9psztT
 0TODGTKqMx+AtTDGDHX8HnfrAUiv4culEwt186ipUksQKkyT5uwQjZV6tkBe27MR
 Vky5w21hGD+qpiCXr6zpZWjO2INPpg6QvbJELBTz9T/YiV2umRoz/8Xm/tgJZyHo
 wJ7oo4Ii4xewdCsqbjEj9RC2ODJaSuhye81TNzA==;
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-08;
 repo=github.com/dkim2wg/interop; date=2026-10-28; sw=lmtpprox;
 action=mi-m=1; hc=11;
 hn=cc,content-type,date,feedback-id,from,in-reply-to,message-id,
 mime-version,references,subject,to;
Message-Instance: m=1;
 h=sha256:WmLKV84aC7TqxoiVU+hl7cN2mKHxHuja14u1OSCgoGM=:mljzGSxLyx9uNfC7G0c7lFcK3zkynw8Tq8r6zhQjeeM=;
X-ME-Sender: <xms:hCzjaiGuH6hEc4BScgzAqndvMykVf1Jn88DKukaG7YENxWc2WSiIgg>
 <xme:hCzjaqWKiZMlu6EJb-403vI_bNxWG8Rg45Ty02UMJNKDyzVT0tQlBugh5uIuj2lCV
 7__QB4kY3xuEfEQz5Ejq76Az-1OFcb9GjjONoCibsXGTJdXG-ej1XE>
X-ME-Received: <xmr:hCzjahJUJrinKPgtWY6mBpGdLOkAAl0mXKQAcTF8gXoeDu62LVNqGlGM70ZCOdqKaGgiQkCpOOV_juWsgUYUKUu8k_wVZCpdRw>
X-ME-Proxy-Cause: dmFkZTFIOkrtvlb9b37wKspCxRUsvfZWDrSTJvGOWsvSreho/jA5LMyk4Wxh6cW2dhKXQN
 eYYfIkHqhQHOPCWH7iIKR7r1ybo8vgnVa52nN3vwk7hgNiI/QBH9kHtIwzE6kR4ySYOJsi
 cVfXofb+GK10lHpFgyLUoA9YaAExXKU7i/MS1zC+hOzpbK6rsXjLzpgBBPmYIwZW3pbcq8
 Tj6gpeu1ul7E/wGy0k0duYEpH5WXnX2IbHu2nbJ/vEmu60qLcYlNx5fNsOpFEvSbsBbb3I
 DKrQ6sEzc0TStI0UREIA20zXj+K/1dyf4Unv9jlz0wyHwve7je7tx8IOSED5bUBh9aqXrm
 +6TOYTMgk5kgfXRkfTbQeQB/g/BU4QqGdewLmPBDvonIUK8xs8UllMJNoNtDWijMbJNzYT
 0tOGo/rnQZR5UDRAu+o2oJIdSXHVz1A92lrTMSXbYyhOjWu4ewxF/XkQVYZjRLTG121O3P
 kw3dWkariteTjeF/KB3TpECgwKtts5rNHQEfyR0p3wE/wXfvA2MUPyPBHHQcz8Vlh0uqen
 n59mWCFxIsXmJE0K94F1cayvmMyinxQTj/Em948Cz5OgbtmuFIw/n92ZcbHbQRkrsrXvS+
 euV/nVBqtuV8V09xbUCEQZM2z5bW42EuQITSFSwC1TxEHfcWT94qN00oh3JA
X-ME-Proxy: <xmx:hCzjaq8Fks0D3nrvaPwCgWB0dK_F5qu5snZG0_GUJR0XP26PIEmGgg>
 <xmx:hCzjakLb3GTbTjodyWm4YvCLzxVWmO_ZaQT2Z75edLCmAjkGsBMN5g>
 <xmx:hCzjavn0dAoZtmIJxD7AB555CO8sxnG-KrajrkzUol2-INWcqFr8fQ>
 <xmx:hCzjaoMXW9Mg-gUCGvuairS1FPOjeVM9vLo3TxeMF4xqyFQWeglANQ>
 <xmx:hCzjaqC0gbFsk1529g9vD30wA686zPaEPs6wMHNTNvPzL7gBq0AJUUH5>
Feedback-ID: i62564b17:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 29 Oct 2026 07:22:44 -0400 (EDT)
Received: by athena.silentflame.com (Postfix, from userid 1000)
 id 5D9C727CC5D; Thu, 29 Oct 2026 11:22:43 +0000 (GMT)
From: Sean Whitton <spwhitton@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#82128: 32.0.50; 256-colour terminal can get a spurious grey
 background
In-Reply-To: <86h5i4x18r.fsf@HIDDEN>
References: <875wymm0xv.fsf@HIDDEN> <8633tpyem1.fsf@HIDDEN>
 <87bj8clupz.fsf@HIDDEN>
 <875wykltzb.fsf@HIDDEN> <86h5i4x18r.fsf@HIDDEN>
Date: Thu, 29 Oct 2026 11:22:43 +0000
Message-ID: <871p98lpj0.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 82128
Cc: vincent@HIDDEN, 82128 <at> debbugs.gnu.org, jared@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii [29/Oct 12:14pm +02] wrote:
>> Basically, it looks like code that is called only for the initial frame,
>> in startup.el, is undoing what Jared made xterm.el do.
>
> But AFAIU you said earlier that the problem only happens in client
> frames?  So the situation you show above actually leads to a correct
> behavior?  Or what am I missing?

My test shows that 'emacs -nw' frames are only _accidentally_
unaffected.  frame-notice-user-settings nullifies the effects of (part
or all of) Jared's changes to xterm.el.  Although that means this
particular bug does not arise, it can't be correct -- why have xterm.el
make those changes at all, if they are undone shortly afterwards?

> As for what could undo what Jared made xterm.el do: it's probably this
> part from frame-notice-user-settings:
>
> 	      (when (assq 'background-color newparms)
> 		(unless (or (assq 'background-mode initial-frame-alist)
> 			    (assq 'background-mode default-frame-alist))
> 		  (frame-set-background-mode frame))
> 		(face-set-after-frame-default frame newparms))))))
>
> But I admit I don't understand the significance of "#ffffffffffff", in
> the following quote from your earlier message:
>
>> Commit 61b1554332 introduces xterm--maybe-update-default-face which
>> means that we call (set-face-background 'default "#ffffffffffff").

Sorry, that was oblique.
I meant this code in xterm--maybe-update-default-face:

    (when (and bg-color (string-equal default-bg "unspecified-bg"))
          (let ((r (car bg-color))
                (g (cadr bg-color))
                (b (caddr bg-color)))
            (set-face-background 'default (format "#%04x%04x%04x" r g b) frame)))

I traced it and (set-face-background 'default "#ffffffffffff") is what
gets called.

> And finally: is it possible that the problem started happening after
> the recent changes of how frame-parameter and frame-parameters work?

I just confirmed that the bug is reproducible at 61b1554332 itself, so I
don't think so.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#82128; Package emacs. Full text available.

Message received at 82128 <at> debbugs.gnu.org:


Received: (at 82128) by debbugs.gnu.org; 29 Oct 2026 10:14:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 29 06:14:24 2026
Received: from localhost ([127.0.0.1]:54697 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1xMN9L-0002M6-Rv
	for submit <at> debbugs.gnu.org; Thu, 29 Oct 2026 06:14:24 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:52568)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1xMN9J-0002Kw-52
 for 82128 <at> debbugs.gnu.org; Thu, 29 Oct 2026 06:14:22 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1xMN9D-0002MG-3X; Thu, 29 Oct 2026 06:14:15 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=88bi1Ki221GghU+n6borWvIqI93uMH7AoGpX0Ibpdic=; b=L1pSs+10HpDr
 qQgWMUJhjDYjAjoIWcYb4L4ahylS+vgAwSSbRwN58aBjCyhA9YkkHc96AmV7++3NyILZN36DYSAhb
 Xr9QyA672/GeufOZ19ZBnZQm/VdQ7VQD4ZVYZ2HB2LAhXhkzVs9z93weOdnaXAMb71t9vLgldVWRA
 hCcjx/60w7UzmCAhyLTnvJ6aaSpQDl4ri23g6ahJAY1vLv1ecFoSRezH7cJ3Ks098KF2+N+EkWabD
 se1brp3lZlKgAyvSdVDhOkevMysFK+PMMawVoip+7kGTYozo9WpSdB+jmFRqNWUSCMTb9KFQuIwsp
 cuHRZ8NoCfzPvuhadSDkxg==;
Date: Thu, 29 Oct 2026 12:14:12 +0200
Message-Id: <86h5i4x18r.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Sean Whitton <spwhitton@HIDDEN>
In-Reply-To: <875wykltzb.fsf@HIDDEN> (message from Sean
 Whitton on Thu, 29 Oct 2026 09:46:32 +0000)
Subject: Re: bug#82128: 32.0.50; 256-colour terminal can get a spurious grey
 background
References: <875wymm0xv.fsf@HIDDEN> <8633tpyem1.fsf@HIDDEN>
 <87bj8clupz.fsf@HIDDEN>
 <875wykltzb.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 82128
Cc: vincent@HIDDEN, 82128 <at> debbugs.gnu.org, jared@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Sean Whitton <spwhitton@HIDDEN>
> Cc: 82128 <at> debbugs.gnu.org, jared@HIDDEN, vincent@HIDDEN
> Date: Thu, 29 Oct 2026 09:46:32 +0000
> 
> Sean Whitton [29/Oct  9:30am GMT] wrote:
> > Eli Zaretskii [28/Oct  6:27pm +02] wrote:
> >> I'm not sure we understand the problem well enough to discuss
> >> solutions.  Do you understand why it happens only in client frames?
> >
> > Sort-of -- see diff below, which with
> >
> >     mkdir -p ti && infocmp -x -1 xterm-256color | grep -Ev '^\s*(Tc|RGB),$' >ti/src \
> >         && tic -x -o ti ti/src && TERMINFO=ti COLORTERM= src/emacs -q -nw
> >
> > produces *Messages* output:
> >
> >     xterm.el before: default face background: "unspecified-bg"
> >     xterm.el after: default face background: "#ffffffffffff"
> >     For information about GNU Emacs and the GNU system, type C-h C-a.
> >     Before frame-notice-user-settings: default face background: "#ffffffffffff"
> >     After frame-notice-user-settings: default face background: "unspecified-bg"
> 
> Basically, it looks like code that is called only for the initial frame,
> in startup.el, is undoing what Jared made xterm.el do.

But AFAIU you said earlier that the problem only happens in client
frames?  So the situation you show above actually leads to a correct
behavior?  Or what am I missing?

As for what could undo what Jared made xterm.el do: it's probably this
part from frame-notice-user-settings:

	      (when (assq 'background-color newparms)
		(unless (or (assq 'background-mode initial-frame-alist)
			    (assq 'background-mode default-frame-alist))
		  (frame-set-background-mode frame))
		(face-set-after-frame-default frame newparms))))))

But I admit I don't understand the significance of "#ffffffffffff", in
the following quote from your earlier message:

> Commit 61b1554332 introduces xterm--maybe-update-default-face which
> means that we call (set-face-background 'default "#ffffffffffff").

And finally: is it possible that the problem started happening after
the recent changes of how frame-parameter and frame-parameters work?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#82128; Package emacs. Full text available.

Message received at 82128 <at> debbugs.gnu.org:


Received: (at 82128) by debbugs.gnu.org; 29 Oct 2026 09:46:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 29 05:46:41 2026
Received: from localhost ([127.0.0.1]:39213 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1xMMiW-0003Q6-WB
	for submit <at> debbugs.gnu.org; Thu, 29 Oct 2026 05:46:41 -0400
Received: from fout-a1-smtp.messagingengine.com ([103.168.172.144]:53137)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
 id 1xMMiU-0003OT-H5
 for 82128 <at> debbugs.gnu.org; Thu, 29 Oct 2026 05:46:38 -0400
Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41])
 by mailfout.phl.internal (Postfix) with ESMTP id 485E7EC028C
 for <82128 <at> debbugs.gnu.org>; Thu, 29 Oct 2026 05:46:33 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
 by phl-compute-01.internal (MEProxy); Thu, 29 Oct 2026 05:46:33 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name;
 h=cc:cc:content-type:content-type:date:date:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:subject:subject:to:to; s=fm1; t=1793267193; x=
 1793353593; bh=cNfC9mc5CwUFTRsMdFOahrB/PoQBRTQORapVvTkaxrM=; b=i
 RM5QAnALOKgN3XwXK7iWnDwwKuDN6GmLYgHKmtFDGv5AeLNQz8R/iELKAffuQd9+
 AU29M3npe76WV+KdodmpSWmZathfgd7Vb48YQZbfUp3qY4lX+Z184afR/YP2kUte
 qZXlnn2iD9xo8yNbVF/IZan2kOVtRLur97C3UtFFgmTR4b12fzq4/QB7r+/KnwgQ
 WuSKc1kU9KCQ+AI79yXW2NmEKhQWsOu6tH+ofNu3Wf0CUK7I3szXhUuA3kjTLKzM
 ILDfYL/bPZMZGqlNb7cdWzKX5D5+TQVcZrdEE+TDOBMNdctv1HF1pj1ZBjATtWKz
 LSyA9NfKAhJ+0hbDQHU/A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-type:content-type:date:date
 :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
 :message-id:mime-version:references:reply-to:subject:subject:to
 :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
 1793267193; x=1793353593; bh=cNfC9mc5CwUFTRsMdFOahrB/PoQBRTQORap
 VvTkaxrM=; b=Ep5Od+u5cmlQedBEpZ1Bno7ncJa3ey7p1l7FLkHZ6uP9Wcj1PLa
 nuhvO85+rsNtkKjgX6GcTtHDrfEhKzvB5qf7kiHAlL+AxBlBsPeJ5B7hlDL0zgic
 bxAC+9k4plSDvp/CBZXPrwa35m9OJEmMqunIKJOElMAvXGU7XnNZqvM4aiXLmp90
 GhYBbSqq7KLm5kVMhS8XQfpW35ARA+V5bPtozvfdVMcvvgT5EGCY2pgCLSSB+C+S
 BeRWFNz86mRHfFnsh0mYqKU8DKuy/KpXNlQuE9mo/SrWrE0f4fkq4HdML2aW0jy4
 3DzwVtAYQrtJYP772/rXVrnUqP4U+uUKG5A==
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-08;
 repo=github.com/dkim2wg/interop; date=2026-10-28; sw=lmtpprox;
 action=sign d=spwhitton.name a=rsa-sha256;
DKIM2-Signature: i=1; m=1; t=1793267193; d=spwhitton.name;
 mf=PHNwd2hpdHRvbkBzcHdoaXR0b24ubmFtZT4=;
 rt=PDgyMTI4QGRlYmJ1Z3MuZ251Lm9yZz4=;
 s=fm1:rsa-sha256:bpSR5/3fNlDMf1M6g2nugOIr/H6cGY8A6SulIHFhK0feio9
 xPE5BtMLUJ1/dtS7eF+xonSi+9YJLSiidt62LxNclwCFMCtXp2ztFsMj/BQqLKpC
 H6HIJe4UGrdivkMW1tsDMjaJS1XH1PAqf8EU/eH0w90IVSV98ySACGZXHIkudPma
 IphJtOSoHhbvKOAGFcKFx4SIKa0++5Le7h2gblPnqum8xOFhfQGfw7bxGunzljmR
 LllRwemuZMgJUsjArTOwS0dYhrUn4LPUb78eWO+6sg52ot86Y4kU0NPKYfqVfEay
 +4Fp5IYp/E2Y+JOAIBEZfYOppK7hrk9C5Z9Xryg==;
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-08;
 repo=github.com/dkim2wg/interop; date=2026-10-28; sw=lmtpprox;
 action=mi-m=1; hc=11;
 hn=cc,content-type,date,feedback-id,from,in-reply-to,message-id,
 mime-version,references,subject,to;
Message-Instance: m=1;
 h=sha256:GEW68slwXqqgyPiLR6OUhwE2y6zUq4nTiKVN9DKeyi0=:0kRH9Jv0TERaONhEltsSbFvogW/s/vF1hhDq1QjatN0=;
X-ME-Sender: <xms:-RXjasLxu-5tP_nTLosS56XpOc2qFSqZN8dfuAh7XfJGKwRfFalhFA>
 <xme:-RXjajL8QP8bn_5_UYMseK_lwOTxx8Rg10ubH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7PP7lcBV8YJZTxOWnN2SJTKl7SqqxUKiB7HuzSjw>
 <xmx:-RXjahzmX1GZYLAXqNz_C09kBWDr2iP7nbr-CrwPGeZSDDsbYElBzQ>
 <xmx:-RXjarnDto_V-bOncIruXrecCRxGV6PIiLWfLm3JI2iIojE2Cn33aE9V>
Feedback-ID: i62564b17:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 29 Oct 2026 05:46:32 -0400 (EDT)
Received: by athena.silentflame.com (Postfix, from userid 1000)
 id 3A6F827CC59; Thu, 29 Oct 2026 09:46:32 +0000 (GMT)
From: Sean Whitton <spwhitton@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#82128: 32.0.50; 256-colour terminal can get a spurious grey
 background
In-Reply-To: <87bj8clupz.fsf@HIDDEN>
References: <875wymm0xv.fsf@HIDDEN> <8633tpyem1.fsf@HIDDEN>
 <87bj8clupz.fsf@HIDDEN>
Date: Thu, 29 Oct 2026 09:46:32 +0000
Message-ID: <875wykltzb.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 82128
Cc: vincent@HIDDEN, 82128 <at> debbugs.gnu.org, jared@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Sean Whitton [29/Oct  9:30am GMT] wrote:
> Eli Zaretskii [28/Oct  6:27pm +02] wrote:
>> I'm not sure we understand the problem well enough to discuss
>> solutions.  Do you understand why it happens only in client frames?
>
> Sort-of -- see diff below, which with
>
>     mkdir -p ti && infocmp -x -1 xterm-256color | grep -Ev '^\s*(Tc|RGB),$' >ti/src \
>         && tic -x -o ti ti/src && TERMINFO=ti COLORTERM= src/emacs -q -nw
>
> produces *Messages* output:
>
>     xterm.el before: default face background: "unspecified-bg"
>     xterm.el after: default face background: "#ffffffffffff"
>     For information about GNU Emacs and the GNU system, type C-h C-a.
>     Before frame-notice-user-settings: default face background: "#ffffffffffff"
>     After frame-notice-user-settings: default face background: "unspecified-bg"

Basically, it looks like code that is called only for the initial frame,
in startup.el, is undoing what Jared made xterm.el do.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#82128; Package emacs. Full text available.

Message received at 82128 <at> debbugs.gnu.org:


Received: (at 82128) by debbugs.gnu.org; 29 Oct 2026 09:30:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 29 05:30:42 2026
Received: from localhost ([127.0.0.1]:60149 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1xMMT3-0007pb-HG
	for submit <at> debbugs.gnu.org; Thu, 29 Oct 2026 05:30:42 -0400
Received: from fout-a1-smtp.messagingengine.com ([103.168.172.144]:54647)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
 id 1xMMT1-0007my-0f
 for 82128 <at> debbugs.gnu.org; Thu, 29 Oct 2026 05:30:39 -0400
Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51])
 by mailfout.phl.internal (Postfix) with ESMTP id 7EA8CEC0143
 for <82128 <at> debbugs.gnu.org>; Thu, 29 Oct 2026 05:30:33 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
 by phl-compute-11.internal (MEProxy); Thu, 29 Oct 2026 05:30:33 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name;
 h=cc:cc:content-type:content-type:date:date:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:subject:subject:to:to; s=fm1; t=1793266233; x=
 1793352633; bh=7VbiAj7urBdMkPMHELUgqhu1FO2rxo+GzHMvHW6kpzM=; b=l
 UtynhT5aEvvhokayq5R/CGymhldxSkSlJ80ds2NtYh7turAX7gj0y5U/sVR1odQ/
 yNWGHf5o7LlVDcohWCt1qzszjyJ9LtB7tHgeRhlgQQl9X1GEWWBchnuz0RzfFIUE
 hVj4ljoIPUgxlTPcOMU+rL3MMHEmNwEKjjNtKSHQ0ih4aEVcCczSbQTib3IOJ7s2
 H88dCRCOLBvHPh1/HqrCPLPEwf1n9dAO5P+B1ndSgwfR89mbr5WIRnAz54DlpSrV
 /tVYar9QruYt07l+rqF8UWqcRzgoedeNxjwT6g4jXPT+bXIaTkPJPJT7mBIsyGIo
 d+VOR32ffheV+1Tatjm7Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-type:content-type:date:date
 :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
 :message-id:mime-version:references:reply-to:subject:subject:to
 :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
 1793266233; x=1793352633; bh=7VbiAj7urBdMkPMHELUgqhu1FO2rxo+GzHM
 vHW6kpzM=; b=SNPpc9YDwJL2n8CypfLVPzcE33jSa8kyIwnFd64uEsep5sVrZJQ
 52hlHYZz8Din/HJgobGPmz7ETOk3xbJV0COQiqlsk/XAEkcs5TxXA4eY3eyvwAAr
 fNqwbYgk+mEG7puh2ZEJjNmRetgcE48uTV55ewOmXgpY8P2JbdQltDN3+9Pzs0G2
 INEEJq+gMMfjQZ+S0Y59muuLtU3xjEk0S4jJPkNc8joRT32ahvegM9YN4XCR/HBo
 MyzlBky8e84QYvgg7dRLkLCgzKNzJZDols3mQS9mrkAnKfTO6kW6nJzodaBtGCGg
 OaZZd15N9yMiXXVme4AipgLinMmCkpWHdJQ==
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-08;
 repo=github.com/dkim2wg/interop; date=2026-10-28; sw=lmtpprox;
 action=sign d=spwhitton.name a=rsa-sha256;
DKIM2-Signature: i=1; m=1; t=1793266233; d=spwhitton.name;
 mf=PHNwd2hpdHRvbkBzcHdoaXR0b24ubmFtZT4=;
 rt=PDgyMTI4QGRlYmJ1Z3MuZ251Lm9yZz4=;
 s=fm1:rsa-sha256:eclAwI1B5ioRfg4O8V1pcnGl3YIqqTQwrWf7MQ93mS7faXk
 0vVP9csCNNa+Pvv4R1qbW50MmSvs+kYpW+RTi4uj1HeFj9tahN6n6hVIu0xXg8LL
 PUU4U/vNE1nmluz3MMi+FtecPOyToXqNQ/6H8Hjvf1miAZRhtisEDDLRmRHvpKG4
 zBtl6EQg5w+Be4ZZo9eN4RJAOZRdJnMtnBRXVokwLvKJ5WiPlXx5zrDMAyUFkeB8
 gFN9o+zCG7jQ/EPYQX6esWql/L0JMZuvvl8ESRQPAPWtw6zk7Xxnv5Z1vmJNeNSd
 Bc7BnS6SVsBy8rN2LhudjSQ2i1cEQ2JzBRNiWqA==;
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-08;
 repo=github.com/dkim2wg/interop; date=2026-10-28; sw=lmtpprox;
 action=mi-m=1; hc=11;
 hn=cc,content-type,date,feedback-id,from,in-reply-to,message-id,
 mime-version,references,subject,to;
Message-Instance: m=1;
 h=sha256:4iCmTmIVtMLv1IzWsg6o99032F9prZyg4sIRG4T339s=:3652As+nOJ54cRURaKXgFkjvPSWU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:ORLjatWTlV1nlFQwuUznZbSkf0MJbhMRjt-Yc0V01H1rwEKF56uBqw>
 <xmx:ORLjanCFHucdIaKDjB_Ywcf47g6FRpxY61AL4DZzpKkcCtD24bkGSQ>
 <xmx:ORLjao--t0Xp8oObykyWSXrfBjfcPrPHEsU5HrPtkeA2OoYk0pZqSw>
 <xmx:ORLjamGwL_oXE4gBSzPzai9ZZLHdm1xHtn1aitzZRYnFbZ-a3xnaCw>
 <xmx:ORLjan4UGpBkPEm_yhRIJJzhIfwy6AGo9Y3rEdO26d83hKklsmaLsJE0>
Feedback-ID: i62564b17:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 29 Oct 2026 05:30:33 -0400 (EDT)
Received: by athena.silentflame.com (Postfix, from userid 1000)
 id 7017B27CC5D; Thu, 29 Oct 2026 09:30:32 +0000 (GMT)
From: Sean Whitton <spwhitton@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#82128: 32.0.50; 256-colour terminal can get a spurious grey
 background
In-Reply-To: <8633tpyem1.fsf@HIDDEN>
References: <875wymm0xv.fsf@HIDDEN> <8633tpyem1.fsf@HIDDEN>
Date: Thu, 29 Oct 2026 09:30:32 +0000
Message-ID: <87bj8clupz.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 82128
Cc: vincent@HIDDEN, 82128 <at> debbugs.gnu.org, jared@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii [28/Oct  6:27pm +02] wrote:
> I'm not sure we understand the problem well enough to discuss
> solutions.  Do you understand why it happens only in client frames?

Sort-of -- see diff below, which with

    mkdir -p ti && infocmp -x -1 xterm-256color | grep -Ev '^\s*(Tc|RGB),$' >ti/src \
        && tic -x -o ti ti/src && TERMINFO=ti COLORTERM= src/emacs -q -nw

produces *Messages* output:

    xterm.el before: default face background: "unspecified-bg"
    xterm.el after: default face background: "#ffffffffffff"
    For information about GNU Emacs and the GNU system, type C-h C-a.
    Before frame-notice-user-settings: default face background: "#ffffffffffff"
    After frame-notice-user-settings: default face background: "unspecified-bg"

-- >8 --
diff --git a/lisp/startup.el b/lisp/startup.el
index 9daf0431104..772a344e36b 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -3101,14 +3101,16 @@ command-line-1
                    (assoc (font-xlfd-name (face-attribute 'default :font))
                           face-font-rescale-alist #'string-match-p))
 	  (set-face-attribute 'default nil :font (font-spec)))
-
+        (message "Before frame-notice-user-settings: default face background: %S"
+           (face-attribute 'default :background))
         ;; It's important to notice the user settings before we
         ;; display the startup message; otherwise, the settings
         ;; won't take effect until the user gives the first
         ;; keystroke, and that's distracting.
         (when (fboundp 'frame-notice-user-settings)
           (frame-notice-user-settings))
-
+        (message "After frame-notice-user-settings: default face background: %S"
+                 (face-attribute 'default :background))
         ;; If there are no switches to process, we might as well
         ;; run this hook now, and there may be some need to do it
         ;; before doing any output.
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 3bef88d5010..a6158a24b2f 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -1013,6 +1013,8 @@ xterm--init
   (when xterm-update-cursor
     (xterm--init-update-cursor))
 
+  (message "xterm.el before: default face background: %S"
+           (face-attribute 'default :background))
   (let ((bg-color (terminal-parameter nil 'xterm--background-color))
         (fg-color (terminal-parameter nil 'xterm--foreground-color)))
     (when bg-color
@@ -1032,6 +1034,8 @@ xterm--init
       ;; Manually update, after-make-frame-functions was already called
       ;; for initial frame.
       (xterm--maybe-update-default-face (selected-frame))))
+  (message "xterm.el after: default face background: %S"
+           (face-attribute 'default :background))
 
   (when (and (not xterm-mouse-mode-called)
              ;; Only automatically enable xterm mouse on terminals
-- 
Sean Whitton




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#82128; Package emacs. Full text available.

Message received at 82128 <at> debbugs.gnu.org:


Received: (at 82128) by debbugs.gnu.org; 28 Oct 2026 16:28:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 28 12:28:05 2026
Received: from localhost ([127.0.0.1]:51812 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1xM6VQ-0003Ar-TZ
	for submit <at> debbugs.gnu.org; Wed, 28 Oct 2026 12:28:05 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40026)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1xM6VO-00038T-OI
 for 82128 <at> debbugs.gnu.org; Wed, 28 Oct 2026 12:28:03 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1xM6VI-0006vv-Ca; Wed, 28 Oct 2026 12:27:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=vHGyAHHvD+7EmAXne6rRLDxY3pmsoDqZHmilfmbYAUg=; b=hnmSojduuHBc
 bdF4nVqHVW+KjXzGDukaGbJSj6scDDp8x8iM9RRxmxNIN9ETJfjMyN6U6S+OQnjCAtJvSlSUNexJT
 BpHgu8FOaxf3QHg9f1o0UtmaIlRAA4nKt2+yOlK1Owv2oehAydLDJWxx9lmPAcVzrsPB+ykCqV2MG
 pMvx411ZXB3hFdYDxVNAaaJT5i1vur0jGeVTtK/2UCCnEeNkGynridAzpgjZDet0q7axnL5cqlLWU
 RKEiCqx+gXjeMZ/9plDQhpOdky6+cSCKWGHBeNDiYFxQl741+Gu3YEJSxGKaIySOF5fQM5xi6XHMr
 1wJ9UJSMAZq1DMcVC0Kj0Q==;
Date: Wed, 28 Oct 2026 18:27:50 +0200
Message-Id: <8633tpyem1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Sean Whitton <spwhitton@HIDDEN>
In-Reply-To: <875wymm0xv.fsf@HIDDEN> (message from Sean
 Whitton on Wed, 28 Oct 2026 13:03:56 +0000)
Subject: Re: bug#82128: 32.0.50;
 256-colour terminal can get a spurious grey background
References: <875wymm0xv.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 82128
Cc: vincent@HIDDEN, 82128 <at> debbugs.gnu.org, jared@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: jared@HIDDEN, vincent@HIDDEN, eliz@HIDDEN
> From: Sean Whitton <spwhitton@HIDDEN>
> Date: Wed, 28 Oct 2026 13:03:56 +0000
> 
> X-debbugs-cc: jared@HIDDEN, vincent@HIDDEN, eliz@HIDDEN
> 
> Commit 61b1554332 introduces xterm--maybe-update-default-face which
> means that we call (set-face-background 'default "#ffffffffffff").
> On one system of mine, this call makes my frame's background turn grey.
> My local gnome-terminal has #000000 text on a #ffffff background.
> But when I ssh to a headless machine and do 'emacsclient -t' there, it
> gets a grey background.
> 
> The problem is that (tty-color-desc "#ffffffffffff") returns
> ("brightwhite" 15 65535 65535 65535) so this call to set-face-background
> makes Emacs start sending a background colour, instead of just sending
> nothing, and therefore implicitly picking up the terminal's white
> background.
> 
> The problem only occurs for (display-color-cells)=>256.  The headless
> machine's TERMINFO=xterm-256color has that property, but locally I have
> TERMINFO=xterm-256color as true colour.  So to reproduce the problem I
> made a fake xterm-256color terminfo definition:
> 
>     mkdir ti
>     infocmp -x -1 xterm-256color | grep -Ev '^\s*(Tc|RGB),$' >ti/src
>     tic -x -o ti ti/src
>     TERMINFO=ti COLORTERM= src/emacs -Q --daemon=bgtest
>     lib-src/emacsclient -s bgtest -t
> 
> Then I get the grey background that I see when ssh'ing.  If you check
> out a revision older than 61b1554332, the reproduction stops working.
> The problem doesn't happen with 'emacs -nw', only 'emacsclient -t'.
> 
> Could we make map_tty_color handle this case better by making it return
> FACE_TTY_DEFAULT_BG_COLOR when the colour it was asked to map is equal
> to the terminal's xterm--background-color property, and likewise for
> foregrounds?

I'm not sure we understand the problem well enough to discuss
solutions.  Do you understand why it happens only in client frames?
Could it be that "#ffffffffffff" is somehow interpreted in the context
of an 8-color terminal, not xterm-256color?

Jared, any ideas or suggestions?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#82128; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Oct 2026 13:04:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 28 09:04:55 2026
Received: from localhost ([127.0.0.1]:33291 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1xM3Kp-0006ho-0u
	for submit <at> debbugs.gnu.org; Wed, 28 Oct 2026 09:04:55 -0400
Received: from lists1p.gnu.org ([2001:470:142::17]:57592)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
 id 1xM3Km-0006cn-JU
 for submit <at> debbugs.gnu.org; Wed, 28 Oct 2026 09:04:53 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <spwhitton@HIDDEN>)
 id 1xM3Jz-0004cf-ED
 for bug-gnu-emacs@HIDDEN; Wed, 28 Oct 2026 09:04:06 -0400
Received: from fout-a4-smtp.messagingengine.com ([103.168.172.147])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <spwhitton@HIDDEN>)
 id 1xM3Jx-0004ME-Af
 for bug-gnu-emacs@HIDDEN; Wed, 28 Oct 2026 09:04:02 -0400
Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41])
 by mailfout.phl.internal (Postfix) with ESMTP id D4C06EC008B
 for <bug-gnu-emacs@HIDDEN>; Wed, 28 Oct 2026 09:03:57 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
 by phl-compute-01.internal (MEProxy); Wed, 28 Oct 2026 09:03:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name;
 h=cc:content-type:content-type:date:date:from:from:in-reply-to
 :message-id:mime-version:reply-to:subject:subject:to:to; s=fm1;
 t=1793192637; x=1793279037; bh=rxtI6yK5clKGXFPLF75TOZyhjH5Tm0DZ
 cpDlZnvMJ4M=; b=W1Gi7y13U9kU6DqaDYFsdUnNP/fMNFmzJQUcCPtD+ZAlAQ/L
 mB77IdXVZOiVMV2h3zrEk1J3NOcBpuXdeVcTg3GlczlBQAwj2g5BcDC26QXw3i+B
 WXTi45lkiWA8zJuxkWew9cQL7IoA1KdFJbmUoiUc5pSpznrBAbr8tjm1Lf16fAhw
 wJOx9KByFyjspB2dWIfTNc5SjQuWA3eh0vhWljRLIgbW/ti7OHX7QeRm1DWtQuIl
 zjIo40rB5BM4Msia5tf/cKHlHLKNJUBU9xMVo7oX18rR/ItCDREAYPvMAPIZekIO
 wI97lwQ/chWO1PMtPuRIIqx2BKRz/hUq82P4uQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:content-type:date:date
 :feedback-id:feedback-id:from:from:in-reply-to:message-id
 :mime-version:reply-to:subject:subject:to:to:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1793192637; x=
 1793279037; bh=rxtI6yK5clKGXFPLF75TOZyhjH5Tm0DZcpDlZnvMJ4M=; b=A
 VlFGGwl4xlvrVbRTZyC1zXu5FjuXlQ+In1TAUvJ4U6hxauttyj4t0huNcV1zAvHk
 caphnS9vt1Edcrud1Kgjm6Vf+bv/jN2po33xn2vxOypc/TNhnM2MpTx+p3aXJ6Yw
 jfPnPMRPcJIaYlot4YFr3NKHcyElJNXsbPszlIJIUGXv/CtbJ0+jDVf7YleXqXoF
 VR9tdti9XtpRtUtTi5kxiqonpPkAoxGSxAznJ3gS/J8+IqnDOg9Kts9PAiICjLMw
 tvpnfNZl7Vk/hpDdoCBnsmaJhw/687dKE5OE4REuBSM1+tV6oT1y+gNdcd/Sac6r
 AI5S4sNXfzDFnn93xFHJw==
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-08;
 repo=github.com/dkim2wg/interop; date=2026-10-28; sw=lmtpprox;
 action=sign d=spwhitton.name a=rsa-sha256;
DKIM2-Signature: i=1; m=1; t=1793192637; d=spwhitton.name;
 mf=PHNwd2hpdHRvbkBzcHdoaXR0b24ubmFtZT4=;
 rt=PGJ1Zy1nbnUtZW1hY3NAZ251Lm9yZz4=;
 s=fm1:rsa-sha256:jPjrQCpfIot7JfowPLekotzjPifrrTt7m4QRyzGv5XHxbpg
 WEchTp33V3l48CPVEZVT+iFc0/ocO/E4UxYK81DmztQ18iSOI5tGjRVnPtPEkfNj
 O12cZHHfmgYuf9sUSgj2Cvo2A+Ad/PElMmtmSRikUo+N9/7ItCfMyq361g8EsNJY
 cPt86Az0zYhRfU+aEx6rSXIY2MiBjQRhtn0RjtI5cBFk1fYspFmkYSM6VcDQQZQW
 wiKreH9864TY8zSsqBEqFS23oeElcGxYzPsa7Ob4kzFXucWkTkIWoHlwr6XVqUkH
 o5mcMoKbGo1z0KMyF9odPf+tog9S5HLafN75mQg==;
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-08;
 repo=github.com/dkim2wg/interop; date=2026-10-28; sw=lmtpprox;
 action=mi-m=1; hc=8;
 hn=content-type,date,feedback-id,from,message-id,mime-version,
 subject,to;
Message-Instance: m=1;
 h=sha256:EzAT+T+aZ1eN3md6wUbJziDfgR9Obxrs3gvZk/d/+Xk=:uQIbfweC/aqj0S/RtjeZcz4uR88LeQ0CjJCosX16Evs=;
X-ME-Sender: <xms:vfLhaqBPQIlRXM4i2e3nMHv2DQMBPCR5xxwTOufWaGXiGwwwPuRTkA>
 <xme:vfLhaqY4CdIG09FDWQjY7XobiXD--qGt55XWB0THtENhZKgsJQ-b0Ded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-feuieCeKVoedG1TrpXQ>
 <xmx:vfLhanw2CXYmvEIH5Fz6f2RiQhtNCnuBKp21RmB4ao0aJSIyXW6wxQ>
 <xmx:vfLhaoSurPiaym9n82Z4U8ClzyXcwuZzKuh_EsZup3UJaj6gJ_3hIt0W>
Feedback-ID: i62564b17:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA for
 <bug-gnu-emacs@HIDDEN>; Wed, 28 Oct 2026 09:03:57 -0400 (EDT)
Received: by athena.silentflame.com (Postfix, from userid 1000)
 id 979F027CB68; Wed, 28 Oct 2026 13:03:56 +0000 (GMT)
From: Sean Whitton <spwhitton@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 32.0.50; 256-colour terminal can get a spurious grey background
Date: Wed, 28 Oct 2026 13:03:56 +0000
Message-ID: <875wymm0xv.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=103.168.172.147;
 envelope-from=spwhitton@HIDDEN; helo=fout-a4-smtp.messagingengine.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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_NONE=-0.0001, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

X-debbugs-cc: jared@HIDDEN, vincent@HIDDEN, eliz@HIDDEN

Commit 61b1554332 introduces xterm--maybe-update-default-face which
means that we call (set-face-background 'default "#ffffffffffff").
On one system of mine, this call makes my frame's background turn grey.
My local gnome-terminal has #000000 text on a #ffffff background.
But when I ssh to a headless machine and do 'emacsclient -t' there, it
gets a grey background.

The problem is that (tty-color-desc "#ffffffffffff") returns
("brightwhite" 15 65535 65535 65535) so this call to set-face-background
makes Emacs start sending a background colour, instead of just sending
nothing, and therefore implicitly picking up the terminal's white
background.

The problem only occurs for (display-color-cells)=>256.  The headless
machine's TERMINFO=xterm-256color has that property, but locally I have
TERMINFO=xterm-256color as true colour.  So to reproduce the problem I
made a fake xterm-256color terminfo definition:

    mkdir ti
    infocmp -x -1 xterm-256color | grep -Ev '^\s*(Tc|RGB),$' >ti/src
    tic -x -o ti ti/src
    TERMINFO=ti COLORTERM= src/emacs -Q --daemon=bgtest
    lib-src/emacsclient -s bgtest -t

Then I get the grey background that I see when ssh'ing.  If you check
out a revision older than 61b1554332, the reproduction stops working.
The problem doesn't happen with 'emacs -nw', only 'emacsclient -t'.

Could we make map_tty_color handle this case better by making it return
FACE_TTY_DEFAULT_BG_COLOR when the colour it was asked to map is equal
to the terminal's xterm--background-color property, and likewise for
foregrounds?

-- 
Sean Whitton




Acknowledgement sent to Sean Whitton <spwhitton@HIDDEN>:
New bug report received and forwarded. Copy sent to jared@HIDDEN, vincent@HIDDEN, eliz@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to jared@HIDDEN, vincent@HIDDEN, eliz@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#82128; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 29 Oct 2026 11:30:02 UTC

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