GNU bug report logs - #22154
25.0.50; emacsclient -c "breaks" 256-color display in server

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: Eric Hanchrow <eric.hanchrow@HIDDEN>; dated Sat, 12 Dec 2015 21:50:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 22154) by debbugs.gnu.org; 18 Dec 2015 04:59:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 17 23:59:20 2015
Received: from localhost ([127.0.0.1]:55022 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a9n8S-0003di-GQ
	for submit <at> debbugs.gnu.org; Thu, 17 Dec 2015 23:59:20 -0500
Received: from eggs.gnu.org ([208.118.235.92]:39982)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <dann@HIDDEN>) id 1a9n8Q-0003dV-NZ
 for 22154 <at> debbugs.gnu.org; Thu, 17 Dec 2015 23:59:19 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dann@HIDDEN>) id 1a9n8K-0003pF-MB
 for 22154 <at> debbugs.gnu.org; Thu, 17 Dec 2015 23:59:13 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48818)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <dann@HIDDEN>)
 id 1a9n8K-0003pB-IQ; Thu, 17 Dec 2015 23:59:12 -0500
Received: from localhost ([::1]:55897 helo=fencepost.gnu.org)
 by fencepost.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <dann@HIDDEN>)
 id 1a9n8I-0003g7-Fs; Thu, 17 Dec 2015 23:59:10 -0500
From: Dan Nicolaescu <dann@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN> <yxq37v5lfdl.fsf@HIDDEN>
 <83a8pd3txg.fsf@HIDDEN> <yxq37v5yofo.fsf@HIDDEN>
 <834mfl3qvp.fsf@HIDDEN> <yxqsi34cli7.fsf@HIDDEN>
 <83h9jj3dfs.fsf@HIDDEN>
X-Debbugs-No-Ack: yes
Date: Thu, 17 Dec 2015 23:59:08 -0500
In-Reply-To: <83h9jj3dfs.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 15 Dec
 2015 18:05:11 +0200")
Message-ID: <yxq1takwdwj.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 22154
Cc: eric.hanchrow@HIDDEN, 22154 <at> debbugs.gnu.org
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: -5.0 (-----)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Dan Nicolaescu <dann@HIDDEN>
>> Cc: eric.hanchrow@HIDDEN,  22154 <at> debbugs.gnu.org
>> Date: Tue, 15 Dec 2015 00:46:08 -0500
>> 
>> >> What exactly is the problem that your patch fixes?
>> >
>> > The fact that the default escape sequences for turning colors on or
>> > off are stored in global variables that get overwritten each time
>> > another tty is initialized.
>> 
>> Can you describe a behavior that is incorrect?
>
> It was described in the original report of this bug, see
>
>   http://lists.gnu.org/archive/html/bug-gnu-emacs/2015-12/msg00420.html
>   http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22154#5
>
>> > And I don't understand how could what you describe work when there's
>> > only one global value of tty-defined-color-alist.  Can you explain how
>> > that worked, given that each terminal's initialization overwrites that
>> > list?
>> 
>> Sorry, I don't remember the details, but it did work
>> In fact I just tried on emacs 24.5 with 3 terminals: xterm
>> with TERM=vt100, rxvt -fg black -bg white and rxvt -fg white -bg black.
>> emacsclient -t connected to the same emacs daemon
>
> That's not the same use case.  The one you should indeed works,
> because the foreground and background colors are recorded separately
> for each frame.  IOW, this is not related to the issue at hand.

OK, great.  That is actually a very important use-case, and more in line
with what people normally do.  It's good that it still works.




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

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


Received: (at 22154) by debbugs.gnu.org; 15 Dec 2015 16:40:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 15 11:40:47 2015
Received: from localhost ([127.0.0.1]:52883 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8sea-0007MY-5z
	for submit <at> debbugs.gnu.org; Tue, 15 Dec 2015 11:40:47 -0500
Received: from eggs.gnu.org ([208.118.235.92]:38684)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <eliz@HIDDEN>) id 1a8seV-0007MJ-Ht
 for 22154 <at> debbugs.gnu.org; Tue, 15 Dec 2015 11:40:43 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1a8seL-0001pE-6F
 for 22154 <at> debbugs.gnu.org; Tue, 15 Dec 2015 11:40:34 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56944)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1a8seK-0001p9-Q7; Tue, 15 Dec 2015 11:40:28 -0500
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2927
 helo=HOME-C4E4A596F7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1a8seJ-0002AK-Vi; Tue, 15 Dec 2015 11:40:28 -0500
Date: Tue, 15 Dec 2015 18:40:43 +0200
Message-Id: <83a8pb3bsk.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eric Hanchrow <eric.hanchrow@HIDDEN>
In-reply-to: <CAHZoxq_8TTZ993q0GbhXNOKJSsjZyCz98N4ifWDHP4G1YyzStw@HIDDEN>
 (message from Eric Hanchrow on Tue, 15 Dec 2015 16:37:19 +0000)
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN> <yxq37v5lfdl.fsf@HIDDEN>
 <83a8pd3txg.fsf@HIDDEN> <yxq37v5yofo.fsf@HIDDEN>
 <834mfl3qvp.fsf@HIDDEN> <yxqsi34cli7.fsf@HIDDEN>
 <83h9jj3dfs.fsf@HIDDEN>
 <CAHZoxq_8TTZ993q0GbhXNOKJSsjZyCz98N4ifWDHP4G1YyzStw@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 22154
Cc: dann@HIDDEN, 22154 <at> debbugs.gnu.org
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>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Eric Hanchrow <eric.hanchrow@HIDDEN>
> Date: Tue, 15 Dec 2015 16:37:19 +0000
> Cc: 22154 <at> debbugs.gnu.org
> 
> The problem also happens in 24.5. 

Thanks.  So, Dan, you should be able to reproduce it.

> I also noticed that, once the problem has happened, if I close the emacsclient
> frame with C-x 5 0, then create another one with TERM=xterm-256color, the
> colors in the *Colors* buffer are restored.

Yes, of course: doing that initializes a 256-color xterm again, and
that re-fills the list of colors with what was there originally.




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

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


Received: (at 22154) by debbugs.gnu.org; 15 Dec 2015 16:37:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 15 11:37:42 2015
Received: from localhost ([127.0.0.1]:52879 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8sbb-0007IM-4g
	for submit <at> debbugs.gnu.org; Tue, 15 Dec 2015 11:37:42 -0500
Received: from mail-io0-f170.google.com ([209.85.223.170]:35286)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <eric.hanchrow@HIDDEN>) id 1a8sbW-0007I6-NW
 for 22154 <at> debbugs.gnu.org; Tue, 15 Dec 2015 11:37:38 -0500
Received: by mail-io0-f170.google.com with SMTP id q126so25348349iof.2
 for <22154 <at> debbugs.gnu.org>; Tue, 15 Dec 2015 08:37:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc:content-type;
 bh=7yAH7dLfWNYi/opENCLyt4wts7SNEE/qFwzzYApkTF0=;
 b=p1ypLgcIc1F0KiYyzgheGT+0rD96q83VZEnqeVS45VKK7tPM8vwBCFt665pQb8X2uB
 hNBxU7srAwSOOcemFxP74sXfTjnzLcSExSvRd9VDSgjiW4diSunOwf2sW+hXyvGcesiq
 mnm+OHAKbFr0qrxDv691Ryr8rov0uDtUeZ7i/ziMEyVmD6mYe1o686hM9sBnT1P29H00
 p9UlqXNpfEUrG2TiRsfYJTnxEJomG15mh0gTCmVPrzCvQKZn28Lu+j6zvWYqXpqwqyQm
 oi5QIp7FLxpCGz/rbKaTwKp3LO8hGrzUV70IkmvMbXRWj419feYCt4pwlA1C27W3p/yh
 QyuA==
X-Received: by 10.107.25.77 with SMTP id 74mr36045152ioz.196.1450197449103;
 Tue, 15 Dec 2015 08:37:29 -0800 (PST)
MIME-Version: 1.0
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN> <yxq37v5lfdl.fsf@HIDDEN>
 <83a8pd3txg.fsf@HIDDEN> <yxq37v5yofo.fsf@HIDDEN>
 <834mfl3qvp.fsf@HIDDEN> <yxqsi34cli7.fsf@HIDDEN>
 <83h9jj3dfs.fsf@HIDDEN>
In-Reply-To: <83h9jj3dfs.fsf@HIDDEN>
From: Eric Hanchrow <eric.hanchrow@HIDDEN>
Date: Tue, 15 Dec 2015 16:37:19 +0000
Message-ID: <CAHZoxq_8TTZ993q0GbhXNOKJSsjZyCz98N4ifWDHP4G1YyzStw@HIDDEN>
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
To: Eli Zaretskii <eliz@HIDDEN>, Dan Nicolaescu <dann@HIDDEN>
Content-Type: multipart/alternative; boundary=001a113fd4c0cedf820526f2679c
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 22154
Cc: 22154 <at> debbugs.gnu.org
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.7 (/)

--001a113fd4c0cedf820526f2679c
Content-Type: text/plain; charset=UTF-8

On Tue, Dec 15, 2015 at 8:05 AM Eli Zaretskii <eliz@HIDDEN> wrote:

>
> Eric, can you test your scenario with Emacs 24.5, please?
>
> The problem also happens in 24.5.

I also noticed that, once the problem has happened, if I close the
emacsclient frame with C-x 5 0, then create another one with
TERM=xterm-256color, the colors in the *Colors* buffer are restored.

--001a113fd4c0cedf820526f2679c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue, Dec 15=
, 2015 at 8:05 AM Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN" target=
=3D"_blank">eliz@HIDDEN</a>&gt; wrote:=C2=A0<br></div><blockquote class=3D=
"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding=
-left:1ex">
<br>
Eric, can you test your scenario with Emacs 24.5, please?<br><br></blockquo=
te>The problem also happens in 24.5. =C2=A0</div><div class=3D"gmail_quote"=
><br></div><div class=3D"gmail_quote">I also noticed that, once the problem=
 has happened, if I close the emacsclient frame with C-x 5 0, then create a=
nother one with TERM=3Dxterm-256color, the colors in the *Colors* buffer ar=
e restored.<br><div class=3D"gmail_quote"></div><div>=C2=A0</div></div></di=
v>

--001a113fd4c0cedf820526f2679c--




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

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


Received: (at 22154) by debbugs.gnu.org; 15 Dec 2015 16:05:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 15 11:05:15 2015
Received: from localhost ([127.0.0.1]:52825 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8s6B-0006Wy-Ip
	for submit <at> debbugs.gnu.org; Tue, 15 Dec 2015 11:05:15 -0500
Received: from eggs.gnu.org ([208.118.235.92]:53447)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <eliz@HIDDEN>) id 1a8s66-0006WO-Ga
 for 22154 <at> debbugs.gnu.org; Tue, 15 Dec 2015 11:05:10 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1a8s5x-0007SQ-46
 for 22154 <at> debbugs.gnu.org; Tue, 15 Dec 2015 11:05:01 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56287)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1a8s5x-0007SM-0y; Tue, 15 Dec 2015 11:04:57 -0500
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2883
 helo=HOME-C4E4A596F7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1a8s5w-00019w-7H; Tue, 15 Dec 2015 11:04:56 -0500
Date: Tue, 15 Dec 2015 18:05:11 +0200
Message-Id: <83h9jj3dfs.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dan Nicolaescu <dann@HIDDEN>
In-reply-to: <yxqsi34cli7.fsf@HIDDEN> (message from Dan Nicolaescu
 on Tue, 15 Dec 2015 00:46:08 -0500)
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN> <yxq37v5lfdl.fsf@HIDDEN>
 <83a8pd3txg.fsf@HIDDEN> <yxq37v5yofo.fsf@HIDDEN>
 <834mfl3qvp.fsf@HIDDEN> <yxqsi34cli7.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 22154
Cc: eric.hanchrow@HIDDEN, 22154 <at> debbugs.gnu.org
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>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Dan Nicolaescu <dann@HIDDEN>
> Cc: eric.hanchrow@HIDDEN,  22154 <at> debbugs.gnu.org
> Date: Tue, 15 Dec 2015 00:46:08 -0500
> 
> >> What exactly is the problem that your patch fixes?
> >
> > The fact that the default escape sequences for turning colors on or
> > off are stored in global variables that get overwritten each time
> > another tty is initialized.
> 
> Can you describe a behavior that is incorrect?

It was described in the original report of this bug, see

  http://lists.gnu.org/archive/html/bug-gnu-emacs/2015-12/msg00420.html
  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22154#5

> > And I don't understand how could what you describe work when there's
> > only one global value of tty-defined-color-alist.  Can you explain how
> > that worked, given that each terminal's initialization overwrites that
> > list?
> 
> Sorry, I don't remember the details, but it did work
> In fact I just tried on emacs 24.5 with 3 terminals: xterm
> with TERM=vt100, rxvt -fg black -bg white and rxvt -fg white -bg black.
> emacsclient -t connected to the same emacs daemon

That's not the same use case.  The one you should indeed works,
because the foreground and background colors are recorded separately
for each frame.  IOW, this is not related to the issue at hand.

The issue at hand is how a TTY frame interprets a color specified
either by its name, like "LavenderBlush", or by an RGB value, like
#FF12EC.  As you certainly remember, we look for the best match in the
list returned by tty-color-alist, then use the numeric value of that
best match to send the corresponding escape sequence to the TTY
device.

The problem I alluded to has 2 facets:

  . the list which we need to find the best matching supported color
    is overwritten every time we initialize another tty, because that
    list is maintained as a single global variable

  . the escape sequences and the number of supported colors are also
    overwritten, because they are restored from a single static
    variable

My patch solves the 2nd part, but the first also needs to be solved.

> Unfortunately I don't have a more recent emacs version on this machine...

I don't think you need a newer Emacs, the same problem should exist in
24.5.  Just do what the OP did with an Emacs running under a 256-color
xterm and a client frame started under an 8-color xterm.  If this
works in Emacs 24.5, I'm probably missing something very important.

Eric, can you test your scenario with Emacs 24.5, please?




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

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


Received: (at 22154) by debbugs.gnu.org; 15 Dec 2015 05:46:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 15 00:46:17 2015
Received: from localhost ([127.0.0.1]:52116 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8iRF-0007QT-2A
	for submit <at> debbugs.gnu.org; Tue, 15 Dec 2015 00:46:17 -0500
Received: from eggs.gnu.org ([208.118.235.92]:45759)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <dann@HIDDEN>) id 1a8iRD-0007QH-SH
 for 22154 <at> debbugs.gnu.org; Tue, 15 Dec 2015 00:46:16 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dann@HIDDEN>) id 1a8iR7-0002hc-LT
 for 22154 <at> debbugs.gnu.org; Tue, 15 Dec 2015 00:46:10 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45740)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <dann@HIDDEN>)
 id 1a8iR7-0002hY-JB; Tue, 15 Dec 2015 00:46:09 -0500
Received: from localhost ([::1]:54570 helo=fencepost.gnu.org)
 by fencepost.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <dann@HIDDEN>)
 id 1a8iR6-0005uO-VI; Tue, 15 Dec 2015 00:46:09 -0500
From: Dan Nicolaescu <dann@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN> <yxq37v5lfdl.fsf@HIDDEN>
 <83a8pd3txg.fsf@HIDDEN> <yxq37v5yofo.fsf@HIDDEN>
 <834mfl3qvp.fsf@HIDDEN>
X-Debbugs-No-Ack: yes
Date: Tue, 15 Dec 2015 00:46:08 -0500
In-Reply-To: <834mfl3qvp.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 14 Dec
 2015 19:02:34 +0200")
Message-ID: <yxqsi34cli7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 22154
Cc: eric.hanchrow@HIDDEN, 22154 <at> debbugs.gnu.org
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: -5.0 (-----)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Dan Nicolaescu <dann@HIDDEN>
>> Cc: eric.hanchrow@HIDDEN,  22154 <at> debbugs.gnu.org
>> Date: Mon, 14 Dec 2015 11:39:39 -0500
>> 
>> Eli Zaretskii <eliz@HIDDEN> writes:
>> 
>> >> From: Dan Nicolaescu <dann@HIDDEN>
>> >> Cc: Eric Hanchrow <eric.hanchrow@HIDDEN>,  22154 <at> debbugs.gnu.org
>> >> Gcc: nnml+archive:sent-mail-2015
>> >> Date: Mon, 14 Dec 2015 01:21:26 -0500
>> >> 
>> >> Using different number of colors on different ttys should work.
>> >> I just tried it briefly, and it works fine on my Fedora machine with
>> >> 24.5.
>> >> I don't have a very recent version compiled.
>> >> 
>> >> You can try it with
>> >> $ emacs -Q -f server-start&
>> >> Then from an xterm: emacsclient -t
>> >> And then from a different one: env TERM=vt100 emacsclient -t
>> >> 
>> >> The frame in the first xterm should display some colors, the one in the
>> >> second should be b&w...
>> >
>> > This simple use case indeed (almost) works.  (To have it work better,
>> > you need the patch I posted here.)  But in general, the current
>> > implementation doesn't support this, AFAICT, for 2 reasons:
>> 
>> What exactly is the problem that your patch fixes?
>
> The fact that the default escape sequences for turning colors on or
> off are stored in global variables that get overwritten each time
> another tty is initialized.

Can you describe a behavior that is incorrect?

>
>> I don't remember all the details, but having multiple terminal frames
>> running on multiple kinds of terminals, with different color depths and
>> even background modes was heavily tested when the multi-tty work was
>> going on.  One of the usual tests was to have rxvt with both 8 and 256
>> colors and white on black and black on white (rxvt not xterm because
>> rxvt sets an environment variable with the default color and emacs can
>> decide if it's a light or dark background based on that).  It worked
>> fine.
>> Did something break meanwhile or you are dealing with some new thing
>> that was not dealt with back then? 
>
> I don't know.  It's possible that the fact that set_tty_color_mode is
> now called as part of redisplay exposed some issue.
>
> And I don't understand how could what you describe work when there's
> only one global value of tty-defined-color-alist.  Can you explain how
> that worked, given that each terminal's initialization overwrites that
> list?

Sorry, I don't remember the details, but it did work
In fact I just tried on emacs 24.5 with 3 terminals: xterm
with TERM=vt100, rxvt -fg black -bg white and rxvt -fg white -bg black.
emacsclient -t connected to the same emacs daemon
M-x list-faces-display looks correct on all 3 of the simultaneously.
Editing C code in a file displayed on the 3 terminals looks fine,
everything gets fontified with the expected colors everywhere.
Unfortunately I don't have a more recent emacs version on this machine...




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

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


Received: (at 22154) by debbugs.gnu.org; 14 Dec 2015 17:02:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 14 12:02:40 2015
Received: from localhost ([127.0.0.1]:51794 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8WWC-00052i-It
	for submit <at> debbugs.gnu.org; Mon, 14 Dec 2015 12:02:40 -0500
Received: from eggs.gnu.org ([208.118.235.92]:41291)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <eliz@HIDDEN>) id 1a8WW8-00052T-EJ
 for 22154 <at> debbugs.gnu.org; Mon, 14 Dec 2015 12:02:36 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1a8WVz-00041w-8M
 for 22154 <at> debbugs.gnu.org; Mon, 14 Dec 2015 12:02:27 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34837)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1a8WVz-00041r-5d; Mon, 14 Dec 2015 12:02:23 -0500
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1058
 helo=HOME-C4E4A596F7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1a8WVy-0000Mm-Ab; Mon, 14 Dec 2015 12:02:22 -0500
Date: Mon, 14 Dec 2015 19:02:34 +0200
Message-Id: <834mfl3qvp.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dan Nicolaescu <dann@HIDDEN>
In-reply-to: <yxq37v5yofo.fsf@HIDDEN> (message from Dan Nicolaescu
 on Mon, 14 Dec 2015 11:39:39 -0500)
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN> <yxq37v5lfdl.fsf@HIDDEN>
 <83a8pd3txg.fsf@HIDDEN> <yxq37v5yofo.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 22154
Cc: eric.hanchrow@HIDDEN, 22154 <at> debbugs.gnu.org
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>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Dan Nicolaescu <dann@HIDDEN>
> Cc: eric.hanchrow@HIDDEN,  22154 <at> debbugs.gnu.org
> Date: Mon, 14 Dec 2015 11:39:39 -0500
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> From: Dan Nicolaescu <dann@HIDDEN>
> >> Cc: Eric Hanchrow <eric.hanchrow@HIDDEN>,  22154 <at> debbugs.gnu.org
> >> Gcc: nnml+archive:sent-mail-2015
> >> Date: Mon, 14 Dec 2015 01:21:26 -0500
> >> 
> >> Using different number of colors on different ttys should work.
> >> I just tried it briefly, and it works fine on my Fedora machine with
> >> 24.5.
> >> I don't have a very recent version compiled.
> >> 
> >> You can try it with
> >> $ emacs -Q -f server-start&
> >> Then from an xterm: emacsclient -t
> >> And then from a different one: env TERM=vt100 emacsclient -t
> >> 
> >> The frame in the first xterm should display some colors, the one in the
> >> second should be b&w...
> >
> > This simple use case indeed (almost) works.  (To have it work better,
> > you need the patch I posted here.)  But in general, the current
> > implementation doesn't support this, AFAICT, for 2 reasons:
> 
> What exactly is the problem that your patch fixes?

The fact that the default escape sequences for turning colors on or
off are stored in global variables that get overwritten each time
another tty is initialized.

> I don't remember all the details, but having multiple terminal frames
> running on multiple kinds of terminals, with different color depths and
> even background modes was heavily tested when the multi-tty work was
> going on.  One of the usual tests was to have rxvt with both 8 and 256
> colors and white on black and black on white (rxvt not xterm because
> rxvt sets an environment variable with the default color and emacs can
> decide if it's a light or dark background based on that).  It worked
> fine.
> Did something break meanwhile or you are dealing with some new thing
> that was not dealt with back then? 

I don't know.  It's possible that the fact that set_tty_color_mode is
now called as part of redisplay exposed some issue.

And I don't understand how could what you describe work when there's
only one global value of tty-defined-color-alist.  Can you explain how
that worked, given that each terminal's initialization overwrites that
list?




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

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


Received: (at 22154) by debbugs.gnu.org; 14 Dec 2015 16:39:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 14 11:39:56 2015
Received: from localhost ([127.0.0.1]:51759 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8WAC-0002pG-Ad
	for submit <at> debbugs.gnu.org; Mon, 14 Dec 2015 11:39:55 -0500
Received: from eggs.gnu.org ([208.118.235.92]:35233)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <dann@HIDDEN>) id 1a8WA6-0002ow-Re
 for 22154 <at> debbugs.gnu.org; Mon, 14 Dec 2015 11:39:50 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dann@HIDDEN>) id 1a8WA0-0006cC-O2
 for 22154 <at> debbugs.gnu.org; Mon, 14 Dec 2015 11:39:41 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34504)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <dann@HIDDEN>)
 id 1a8WA0-0006c8-L0; Mon, 14 Dec 2015 11:39:40 -0500
Received: from localhost ([::1]:43334 helo=fencepost.gnu.org)
 by fencepost.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <dann@HIDDEN>)
 id 1a8W9z-0005na-VS; Mon, 14 Dec 2015 11:39:40 -0500
From: Dan Nicolaescu <dann@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN> <yxq37v5lfdl.fsf@HIDDEN>
 <83a8pd3txg.fsf@HIDDEN>
X-Debbugs-No-Ack: yes
Date: Mon, 14 Dec 2015 11:39:39 -0500
In-Reply-To: <83a8pd3txg.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 14 Dec
 2015 17:56:43 +0200")
Message-ID: <yxq37v5yofo.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 22154
Cc: eric.hanchrow@HIDDEN, 22154 <at> debbugs.gnu.org
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: -5.0 (-----)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Dan Nicolaescu <dann@HIDDEN>
>> Cc: Eric Hanchrow <eric.hanchrow@HIDDEN>,  22154 <at> debbugs.gnu.org
>> Gcc: nnml+archive:sent-mail-2015
>> Date: Mon, 14 Dec 2015 01:21:26 -0500
>> 
>> Using different number of colors on different ttys should work.
>> I just tried it briefly, and it works fine on my Fedora machine with
>> 24.5.
>> I don't have a very recent version compiled.
>> 
>> You can try it with
>> $ emacs -Q -f server-start&
>> Then from an xterm: emacsclient -t
>> And then from a different one: env TERM=vt100 emacsclient -t
>> 
>> The frame in the first xterm should display some colors, the one in the
>> second should be b&w...
>
> This simple use case indeed (almost) works.  (To have it work better,
> you need the patch I posted here.)  But in general, the current
> implementation doesn't support this, AFAICT, for 2 reasons:

What exactly is the problem that your patch fixes?
I don't remember all the details, but having multiple terminal frames
running on multiple kinds of terminals, with different color depths and
even background modes was heavily tested when the multi-tty work was
going on.  One of the usual tests was to have rxvt with both 8 and 256
colors and white on black and black on white (rxvt not xterm because
rxvt sets an environment variable with the default color and emacs can
decide if it's a light or dark background based on that).  It worked
fine.
Did something break meanwhile or you are dealing with some new thing
that was not dealt with back then? 

Thanks

        --Dan




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

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


Received: (at 22154) by debbugs.gnu.org; 14 Dec 2015 15:56:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 14 10:56:43 2015
Received: from localhost ([127.0.0.1]:51729 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8VUQ-0001mR-GW
	for submit <at> debbugs.gnu.org; Mon, 14 Dec 2015 10:56:42 -0500
Received: from eggs.gnu.org ([208.118.235.92]:52503)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <eliz@HIDDEN>) id 1a8VUO-0001mF-Qv
 for 22154 <at> debbugs.gnu.org; Mon, 14 Dec 2015 10:56:41 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1a8VUG-0003eh-Nc
 for 22154 <at> debbugs.gnu.org; Mon, 14 Dec 2015 10:56:35 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33884)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1a8VUG-0003eb-KA; Mon, 14 Dec 2015 10:56:32 -0500
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4923
 helo=HOME-C4E4A596F7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1a8VUF-0008Mh-IT; Mon, 14 Dec 2015 10:56:31 -0500
Date: Mon, 14 Dec 2015 17:56:43 +0200
Message-Id: <83a8pd3txg.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dan Nicolaescu <dann@HIDDEN>
In-reply-to: <yxq37v5lfdl.fsf@HIDDEN> (message from Dan Nicolaescu
 on Mon, 14 Dec 2015 01:21:26 -0500)
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN> <yxq37v5lfdl.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 22154
Cc: eric.hanchrow@HIDDEN, 22154 <at> debbugs.gnu.org
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>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Dan Nicolaescu <dann@HIDDEN>
> Cc: Eric Hanchrow <eric.hanchrow@HIDDEN>,  22154 <at> debbugs.gnu.org
> Gcc: nnml+archive:sent-mail-2015
> Date: Mon, 14 Dec 2015 01:21:26 -0500
> 
> Using different number of colors on different ttys should work.
> I just tried it briefly, and it works fine on my Fedora machine with
> 24.5.
> I don't have a very recent version compiled.
> 
> You can try it with
> $ emacs -Q -f server-start&
> Then from an xterm: emacsclient -t
> And then from a different one: env TERM=vt100 emacsclient -t
> 
> The frame in the first xterm should display some colors, the one in the
> second should be b&w...

This simple use case indeed (almost) works.  (To have it work better,
you need the patch I posted here.)  But in general, the current
implementation doesn't support this, AFAICT, for 2 reasons:

  . The default escape sequences sent to the terminal for turning
    colors on and off are stored in a single global set of values (the
    default_* variables in term.c).  So every time set_tty_color_mode
    is called, and the frame's parameters don't include the
    tty-color-mode parameter (which is what happens usually) the
    escape sequences get overwritten by the ones of the last tty we
    initialized.  It so happens that the display calls
    set_tty_color_mode each time you switch to a different frame on a
    TTY, so the risk of this happening is quite high, especially if
    some frames do have the tty-color-mode parameter.  The patch I
    sent solves this part.

  . The value of tty-defined-color-alist is global, so every call to a
    terminal-specific FOO-register-default-colors will modify that
    global value with its own colors, and those of the previous tty
    will be lost.  For example, the initialization of xterm-256 fills
    tty-defined-color-alist with colors whose names are "color-0",
    "color-1", etc., but if you later initialize an 8-color xterm,
    these get nuked, and only the 8 or 16 standard colors remain
    there.

The second part problem could only be fixed by making
tty-defined-color-alist a terminal-local variable.

Am I missing something?




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

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


Received: (at 22154) by debbugs.gnu.org; 14 Dec 2015 06:35:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 14 01:35:58 2015
Received: from localhost ([127.0.0.1]:50853 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8Mjl-0003t6-QN
	for submit <at> debbugs.gnu.org; Mon, 14 Dec 2015 01:35:57 -0500
Received: from eggs.gnu.org ([208.118.235.92]:46075)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <dann@HIDDEN>) id 1a8Mjk-0003sq-G1
 for 22154 <at> debbugs.gnu.org; Mon, 14 Dec 2015 01:35:56 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dann@HIDDEN>) id 1a8Mje-0000h0-A5
 for 22154 <at> debbugs.gnu.org; Mon, 14 Dec 2015 01:35:51 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52106)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <dann@HIDDEN>)
 id 1a8Mje-0000gw-73; Mon, 14 Dec 2015 01:35:50 -0500
Received: from localhost ([::1]:60935 helo=fencepost.gnu.org)
 by fencepost.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <dann@HIDDEN>)
 id 1a8Mjc-0001DV-KN; Mon, 14 Dec 2015 01:35:48 -0500
From: Dan Nicolaescu <dann@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
In-Reply-To: <8361025k9u.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 13 Dec
 2015 19:30:05 +0200")
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
X-Debbugs-No-Ack: yes
Date: Mon, 14 Dec 2015 01:35:43 -0500
Message-ID: <yxq1tapczb4.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 22154
Cc: Eric Hanchrow <eric.hanchrow@HIDDEN>, 22154 <at> debbugs.gnu.org
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: -5.0 (-----)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Eric Hanchrow <eric.hanchrow@HIDDEN>
>> Date: Sat, 12 Dec 2015 21:49:10 +0000
>> 
>> I have TERM set to 'xterm-256color'.
>> 
>> I started emacs with `/mnt/emacs-25/src/emacs -Q`
>> 
>> I confirmed that 256 colors "worked" by doing M-x list-colors-display
>> RET, and noting that there were about 256 lines of output, with plenty
>> of different colors.
>> 
>> I typed M-x server-start RET.
>> 
>> In another terminal on the same machine, I typed `TERM=xterm
>> /mnt/emacs-25/lib-src/emacsclient -c`. That displayed a *scratch*
>> buffer, as I'd expected.
>
> Out of curiosity: why would you want to downgrade the number of colors
> in the client frames wrt the number supported by the server?
>
>> In that new frame, I typed `M-x list-colors-display RET`. I noticed
>> that now there were only eight lines of output.
>> 
>> I did C-x 5 0 to delete the new frame, then back in the original frame
>> again typed `M-x list-colors-display RET`, and noted that there were
>> still only eight lines of output.
>
> This was never supported, we always assumed that the number of colors
> on all tty frames is the same.

Using different number of colors on different ttys should work.
I just tried it briefly, and it works fine on my Fedora machine with
24.5.
I don't have a very recent version compiled.

You can try it with
$ emacs -Q -f server-start&
Then from an xterm: emacsclient -t
And then from a different one: env TERM=vt100 emacsclient -t

The frame in the first xterm should display some colors, the one in the
second should be b&w...

Date: Mon, 14 Dec 2015 01:24:09 -0500




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

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


Received: (at 22154) by debbugs.gnu.org; 14 Dec 2015 06:23:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 14 01:23:08 2015
Received: from localhost ([127.0.0.1]:50848 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8MXM-0003Wc-Kh
	for submit <at> debbugs.gnu.org; Mon, 14 Dec 2015 01:23:08 -0500
Received: from eggs.gnu.org ([208.118.235.92]:44228)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <dann@HIDDEN>) id 1a8MXL-0003WR-Q9
 for 22154 <at> debbugs.gnu.org; Mon, 14 Dec 2015 01:23:08 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dann@HIDDEN>) id 1a8MXF-0006mO-Tp
 for 22154 <at> debbugs.gnu.org; Mon, 14 Dec 2015 01:23:02 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51974)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <dann@HIDDEN>)
 id 1a8MXE-0006m9-FK; Mon, 14 Dec 2015 01:23:00 -0500
Received: from dann by fencepost.gnu.org with local (Exim 4.82)
 (envelope-from <dann@HIDDEN>)
 id 1a8MXD-00032n-N6; Mon, 14 Dec 2015 01:22:59 -0500
From: Dan Nicolaescu <dann@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
In-Reply-To: <8361025k9u.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 13 Dec
 2015 19:30:05 +0200")
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
X-Draft-From: ("nntp+news.gmane.org:gmane.emacs.bugs" 109933)
Gcc: nnml+archive:sent-mail-2015
X-Debbugs-No-Ack: yes
Date: Mon, 14 Dec 2015 01:21:26 -0500
Message-ID: <yxq37v5lfdl.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 22154
Cc: Eric Hanchrow <eric.hanchrow@HIDDEN>, 22154 <at> debbugs.gnu.org
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: -5.0 (-----)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Eric Hanchrow <eric.hanchrow@HIDDEN>
>> Date: Sat, 12 Dec 2015 21:49:10 +0000
>> 
>> I have TERM set to 'xterm-256color'.
>> 
>> I started emacs with `/mnt/emacs-25/src/emacs -Q`
>> 
>> I confirmed that 256 colors "worked" by doing M-x list-colors-display
>> RET, and noting that there were about 256 lines of output, with plenty
>> of different colors.
>> 
>> I typed M-x server-start RET.
>> 
>> In another terminal on the same machine, I typed `TERM=xterm
>> /mnt/emacs-25/lib-src/emacsclient -c`. That displayed a *scratch*
>> buffer, as I'd expected.
>
> Out of curiosity: why would you want to downgrade the number of colors
> in the client frames wrt the number supported by the server?
>
>> In that new frame, I typed `M-x list-colors-display RET`. I noticed
>> that now there were only eight lines of output.
>> 
>> I did C-x 5 0 to delete the new frame, then back in the original frame
>> again typed `M-x list-colors-display RET`, and noted that there were
>> still only eight lines of output.
>
> This was never supported, we always assumed that the number of colors
> on all tty frames is the same.

Using different number of colors on different ttys should work.
I just tried it briefly, and it works fine on my Fedora machine with
24.5.
I don't have a very recent version compiled.

You can try it with
$ emacs -Q -f server-start&
Then from an xterm: emacsclient -t
And then from a different one: env TERM=vt100 emacsclient -t

The frame in the first xterm should display some colors, the one in the
second should be b&w...





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

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


Received: (at 22154) by debbugs.gnu.org; 13 Dec 2015 20:49:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 13 15:49:46 2015
Received: from localhost ([127.0.0.1]:50613 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8DaT-0007Pk-TF
	for submit <at> debbugs.gnu.org; Sun, 13 Dec 2015 15:49:46 -0500
Received: from eggs.gnu.org ([208.118.235.92]:38717)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <eliz@HIDDEN>) id 1a8DaS-0007PY-HW
 for 22154 <at> debbugs.gnu.org; Sun, 13 Dec 2015 15:49:44 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1a8DaK-0003q9-2p
 for 22154 <at> debbugs.gnu.org; Sun, 13 Dec 2015 15:49:39 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44137)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1a8DaJ-0003q5-Vk; Sun, 13 Dec 2015 15:49:36 -0500
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3725
 helo=HOME-C4E4A596F7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1a8DaJ-0007zH-7i; Sun, 13 Dec 2015 15:49:35 -0500
Date: Sun, 13 Dec 2015 22:49:44 +0200
Message-Id: <83io423wgn.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eric Hanchrow <eric.hanchrow@HIDDEN>
In-reply-to: <CAHZoxq93UQU+XobYxXzG1wpLt4xKwfPSprcnMcd_2GE9L-YCAA@HIDDEN>
 (message from Eric Hanchrow on Sun, 13 Dec 2015 12:26:10 -0800)
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN>
 <CAHZoxq_vMcb6UmHoS=QktU2Muhi2zC+z4htcsdR-KQQ9Sp8PGw@HIDDEN>
 <83si3643iw.fsf@HIDDEN> <83poya42l5.fsf@HIDDEN>
 <CAHZoxq-59HJQdA=w+XuQzVQqHmPPAKt39JcXhsFxVFFjsqo1aQ@HIDDEN>
 <83oadu3z61.fsf@HIDDEN>
 <CAHZoxq93UQU+XobYxXzG1wpLt4xKwfPSprcnMcd_2GE9L-YCAA@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 22154
Cc: 22154 <at> debbugs.gnu.org
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>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Eric Hanchrow <eric.hanchrow@HIDDEN>
> Date: Sun, 13 Dec 2015 12:26:10 -0800
> Cc: 22154 <at> debbugs.gnu.org
> 
>     You can run the command ‘server-start’ with M-x ser-s RET
>     terminal-init-xterm doin’ its thang.  (tty-color-alist) returns a
> list of length 256.
>     terminal-init-xterm is done.  (tty-color-alist) now returns a list
> of length 8.
>     When done with this frame, type C-x 5 0
> 
> So clearly: xterm.el initialization _is_ getting called for the client
> frame, and it _does_ modify tty-color-alist.

Right.  I guess we will have to make tty-defined-color-alist
terminal-specific, or something.  This will have to wait until after
25.1, sorry.




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

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


Received: (at 22154) by debbugs.gnu.org; 13 Dec 2015 20:26:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 13 15:26:38 2015
Received: from localhost ([127.0.0.1]:50601 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8DE5-0006rn-Rp
	for submit <at> debbugs.gnu.org; Sun, 13 Dec 2015 15:26:38 -0500
Received: from mail-ig0-f177.google.com ([209.85.213.177]:36869)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <eric.hanchrow@HIDDEN>) id 1a8DE3-0006rb-U2
 for 22154 <at> debbugs.gnu.org; Sun, 13 Dec 2015 15:26:36 -0500
Received: by igcto18 with SMTP id to18so69859658igc.0
 for <22154 <at> debbugs.gnu.org>; Sun, 13 Dec 2015 12:26:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc:content-type;
 bh=vS5LiOfuwf+7q6YYDJegr08gfbnzYGdcoPbghnT0Ggg=;
 b=mOhWLRU7txwTc8IRKIIYoVy33z6SE75vj6oCsWxqY8N4O1NVartX9vNnj/SbEkpirS
 RLn4HrA+ALlb3j4elLHETDSOPAP+Dwc4Z4WW0E1/pazLQ47vk4y8Dre1xgxId+hXIp3y
 CSa34CxvajzEHzcM6p6HTfQEqCqKjxQKdP9RAxJwgXfwsxSEU8BVkVN394jz8K1/aauy
 rw1BZtucaV+emK7nwVaAWmoqqjSUPhngE5vdv0KoLf9aCZyiu2bYcXQuPeMx46WeOcf7
 9BGxx9RxoPuHRFWlDPDk5HGKYkkkUwepkfmI0w6Y0h/2iaBp9dG45rP1g183L0qN3ReW
 uYjQ==
X-Received: by 10.50.155.106 with SMTP id vv10mr15050054igb.55.1450038390120; 
 Sun, 13 Dec 2015 12:26:30 -0800 (PST)
MIME-Version: 1.0
Received: by 10.64.27.2 with HTTP; Sun, 13 Dec 2015 12:26:10 -0800 (PST)
In-Reply-To: <83oadu3z61.fsf@HIDDEN>
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN>
 <CAHZoxq_vMcb6UmHoS=QktU2Muhi2zC+z4htcsdR-KQQ9Sp8PGw@HIDDEN>
 <83si3643iw.fsf@HIDDEN> <83poya42l5.fsf@HIDDEN>
 <CAHZoxq-59HJQdA=w+XuQzVQqHmPPAKt39JcXhsFxVFFjsqo1aQ@HIDDEN>
 <83oadu3z61.fsf@HIDDEN>
From: Eric Hanchrow <eric.hanchrow@HIDDEN>
Date: Sun, 13 Dec 2015 12:26:10 -0800
Message-ID: <CAHZoxq93UQU+XobYxXzG1wpLt4xKwfPSprcnMcd_2GE9L-YCAA@HIDDEN>
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/mixed; boundary=001a11346b4828a8e00526cd5fa4
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 22154
Cc: 22154 <at> debbugs.gnu.org
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.7 (/)

--001a11346b4828a8e00526cd5fa4
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Sun, Dec 13, 2015 at 11:51 AM Eli Zaretskii <eliz@HIDDEN> wrote:
>
> > I assume you meant `tty-color-mode-alist'.
>
> No, I meant the value returned by tty-color-alist, which is stored in
> the variable tty-defined-color-alist.

Aha!  As Emily Litella says, "That's quite different" :-)

So I added some "message" calls, as described by the attached patch.
Here's what I see in *Messages* after simply running `emacs -Q`:

    terminal-init-xterm doin=E2=80=99 its thang.  (tty-color-alist) returns=
 a
list of length 8.
    terminal-init-xterm is done.  (tty-color-alist) now returns a list
of length 256.
    For information about GNU Emacs and the GNU system, type C-h C-a.

And here's what I see after I create the new frame:

    You can run the command =E2=80=98server-start=E2=80=99 with M-x ser-s R=
ET
    terminal-init-xterm doin=E2=80=99 its thang.  (tty-color-alist) returns=
 a
list of length 256.
    terminal-init-xterm is done.  (tty-color-alist) now returns a list
of length 8.
    When done with this frame, type C-x 5 0

So clearly: xterm.el initialization _is_ getting called for the client
frame, and it _does_ modify tty-color-alist.

I've put the actual before-and-after values returned from
`(tty-color-alist)' into a second attachment, since the "before" value
is quite long.

--001a11346b4828a8e00526cd5fa4
Content-Type: application/octet-stream; 
	name="0001-Add-some-debugging-to-terminal-init-xterm.patch"
Content-Disposition: attachment; 
	filename="0001-Add-some-debugging-to-terminal-init-xterm.patch"
Content-Transfer-Encoding: base64
Content-ID: <1519d002c4531c580401>
X-Attachment-Id: 1519d002c4531c580401

RnJvbSBiMzI1NjBiNGNkZDJiNTYzMTJmNzI3ZGYwMmZjYzZkZGQwYmNjYmM2IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBFcmljIEhhbmNocm93IDxlcmljLmhhbmNocm93QGdtYWlsLmNv
bT4KRGF0ZTogU3VuLCAxMyBEZWMgMjAxNSAyMDoxOToyMSArMDAwMApTdWJqZWN0OiBbUEFUQ0hd
IEFkZCBzb21lIGRlYnVnZ2luZyB0byB0ZXJtaW5hbC1pbml0LXh0ZXJtCgotLS0KIGxpc3AvdGVy
bS94dGVybS5lbCB8IDUgKysrKy0KIDEgZmlsZSBjaGFuZ2VkLCA0IGluc2VydGlvbnMoKyksIDEg
ZGVsZXRpb24oLSkKCmRpZmYgLS1naXQgYS9saXNwL3Rlcm0veHRlcm0uZWwgYi9saXNwL3Rlcm0v
eHRlcm0uZWwKaW5kZXggMDBlZDAyNy4uZmUyNGI4NSAxMDA2NDQKLS0tIGEvbGlzcC90ZXJtL3h0
ZXJtLmVsCisrKyBiL2xpc3AvdGVybS94dGVybS5lbApAQCAtNzUyLDYgKzc1Miw3IEBAIHh0ZXJt
LS1wdXNoLW1hcAogCiAoZGVmdW4gdGVybWluYWwtaW5pdC14dGVybSAoKQogICAiVGVybWluYWwg
aW5pdGlhbGl6YXRpb24gZnVuY3Rpb24gZm9yIHh0ZXJtLiIKKyAgKG1lc3NhZ2UgInRlcm1pbmFs
LWluaX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attachment; filename="after.el"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_ii4zd0d01

KCgiYmxhY2siIDAgMCAwIDApICgicmVkIiAxIDUyNjg1IDAgMCkgKCJncmVlbiIgMiAwIDUyNjg1
IDApICgieWVsbG93IiAzIDUyNjg1IDUyNjg1IDApICgiYmx1ZSIgNCAwIDAgNjExNjYpICgibWFn
ZW50YSIgNSA1MjY4NSAwIDUyNjg1KSAoImN5YW4iIDYgMCA1MjY4NSA1MjY4NSkgKCJ3aGl0ZSIg
NyA1ODg1MyA1ODg1MyA1ODg1MykpCg==
--001a11346b4828a8e00526cd5fa4
Content-Type: application/octet-stream; name="before.el"
Content-Disposition: attachment; filename="before.el"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_ii4zd0df2

KCgiYmxhY2siIDAgMCAwIDApICgicmVkIiAxIDUyNjg1IDAgMCkgKCJncmVlbiIgMiAwIDUyNjg1
IDApICgieWVsbG93IiAzIDUyNjg1IDUyNjg1IDApICgiYmx1ZSIgNCAwIDAgNjExNjYpICgibWFn
ZW50YSIgNSA1MjY4NSAwIDUyNjg1KSAoImN5YW4iIDYgMCA1MjY4NSA1MjY4NSkgKCJ3aGl0ZSIg
NyA1ODg1MyA1ODg1MyA1ODg1MykgKCJicmlnaHRibGFjayIgOCAzMjYzOSAzMjYzOSAzMjYzOSkg
KCJicmlnaHRyZWQiIDkgNjU1MzUgMCAwKSAoImJyaWdodGdyZWVuIiAxMCAwIDY1NTM1IDApICgi
YnJpZ2h0eWVsbG93IiAxMSA2NTUzNSA2NTUzNSAwKSAoImJyaWdodGJsdWUiIDEyIDIzNjQ0IDIz
NjQ0IDY1NTM1KSAoImJyaWdodG1hZ2VudGEiIDEzIDY1NTM1IDAgNjU1MzUpICgiYnJpZ2h0Y3lh
biIgMTQgMCA2NTUzNSA2NTUzNSkgKCJicmlnaHR3aGl0ZSIgMTUgNjU1MzUgNjU1MzUgNjU1MzUp
ICgiY29sb3ItMTYiIDE2IDAgMCAwKSAoImNv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DMxNzYpICgiY29sb3ItMjQ5IiAyNDkgNDU3NDYgNDU3NDYgNDU3
NDYpICgiY29sb3ItMjUwIiAyNTAgNDgzMTYgNDgzMTYgNDgzMTYpICgiY29sb3ItMjUxIiAyNTEg
NTA4ODYgNTA4ODYgNTA4ODYpICgiY29sb3ItMjUyIiAyNTIgNTM0NTYgNTM0NTYgNTM0NTYpICgi
Y29sb3ItMjUzIiAyNTMgNTYwMjYgNTYwMjYgNTYwMjYpICgiY29sb3ItMjU0IiAyNTQgNTg1OTYg
NTg1OTYgNTg1OTYpICgiY29sb3ItMjU1IiAyNTUgNjExNjYgNjExNjYgNjExNjYpKQo=
--001a11346b4828a8e00526cd5fa4--




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

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


Received: (at 22154) by debbugs.gnu.org; 13 Dec 2015 19:51:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 13 14:51:20 2015
Received: from localhost ([127.0.0.1]:50585 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8Cfw-00061q-LU
	for submit <at> debbugs.gnu.org; Sun, 13 Dec 2015 14:51:20 -0500
Received: from eggs.gnu.org ([208.118.235.92]:56374)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <eliz@HIDDEN>) id 1a8Cfv-00061e-8Q
 for 22154 <at> debbugs.gnu.org; Sun, 13 Dec 2015 14:51:19 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1a8Cfl-0007mt-1i
 for 22154 <at> debbugs.gnu.org; Sun, 13 Dec 2015 14:51:13 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42862)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1a8Cfk-0007mo-Ul; Sun, 13 Dec 2015 14:51:08 -0500
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3417
 helo=HOME-C4E4A596F7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1a8Cfk-000858-6Q; Sun, 13 Dec 2015 14:51:08 -0500
Date: Sun, 13 Dec 2015 21:51:18 +0200
Message-Id: <83oadu3z61.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eric Hanchrow <eric.hanchrow@HIDDEN>
In-reply-to: <CAHZoxq-59HJQdA=w+XuQzVQqHmPPAKt39JcXhsFxVFFjsqo1aQ@HIDDEN>
 (message from Eric Hanchrow on Sun, 13 Dec 2015 18:47:32 +0000)
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN>
 <CAHZoxq_vMcb6UmHoS=QktU2Muhi2zC+z4htcsdR-KQQ9Sp8PGw@HIDDEN>
 <83si3643iw.fsf@HIDDEN> <83poya42l5.fsf@HIDDEN>
 <CAHZoxq-59HJQdA=w+XuQzVQqHmPPAKt39JcXhsFxVFFjsqo1aQ@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 22154
Cc: 22154 <at> debbugs.gnu.org
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>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Eric Hanchrow <eric.hanchrow@HIDDEN>
> Date: Sun, 13 Dec 2015 18:47:32 +0000
> Cc: 22154 <at> debbugs.gnu.org
> 
> I assume you meant `tty-color-mode-alist'.

No, I meant the value returned by tty-color-alist, which is stored in
the variable tty-defined-color-alist.




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

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


Received: (at 22154) by debbugs.gnu.org; 13 Dec 2015 18:47:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 13 13:47:49 2015
Received: from localhost ([127.0.0.1]:50495 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8BgT-0004YZ-5u
	for submit <at> debbugs.gnu.org; Sun, 13 Dec 2015 13:47:49 -0500
Received: from mail-io0-f170.google.com ([209.85.223.170]:33416)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <eric.hanchrow@HIDDEN>) id 1a8BgR-0004YN-FT
 for 22154 <at> debbugs.gnu.org; Sun, 13 Dec 2015 13:47:47 -0500
Received: by iow186 with SMTP id 186so5380661iow.0
 for <22154 <at> debbugs.gnu.org>; Sun, 13 Dec 2015 10:47:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc:content-type;
 bh=mrB+vgqm4MiCqTjk5w92faaAzOfrH3/29/dk/vvXaH4=;
 b=lOpxr6HOyRNGwqgNoD21uoN4PERcG2unScwJElaD3ouKrgaJHPlTDI4RHU4Sc//vKZ
 SV1aVAPSLedFi7fnKJw0x5DykBZCuSIAhWj4g33Pm6806JygMtkyZ8qzQA9mZTzVUrri
 oi6az1ZO2X1Mltidt6I0YwgNVzM2WkCjoDg0CY+3//wgntxGptdFQsT1PkEEQEWL0LzN
 lPb7zn8h5oLD/ZVoLhr3UQfFtUKrDLxYtyZO6EjqloYMzOFdQ8JqQBQK0IpdEM7y2DgH
 h6ZAc8zWQfkWzISlN6rSkjrJBMwsR7mu+/dLx3w764Gr62kjwQBFt2LuSeV12DTpXCOZ
 69Sw==
X-Received: by 10.107.32.209 with SMTP id g200mr23640921iog.39.1450032461858; 
 Sun, 13 Dec 2015 10:47:41 -0800 (PST)
MIME-Version: 1.0
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN>
 <CAHZoxq_vMcb6UmHoS=QktU2Muhi2zC+z4htcsdR-KQQ9Sp8PGw@HIDDEN>
 <83si3643iw.fsf@HIDDEN> <83poya42l5.fsf@HIDDEN>
In-Reply-To: <83poya42l5.fsf@HIDDEN>
From: Eric Hanchrow <eric.hanchrow@HIDDEN>
Date: Sun, 13 Dec 2015 18:47:32 +0000
Message-ID: <CAHZoxq-59HJQdA=w+XuQzVQqHmPPAKt39JcXhsFxVFFjsqo1aQ@HIDDEN>
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary=001a1140cd06cd51e00526cbfd3e
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 22154
Cc: 22154 <at> debbugs.gnu.org
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.7 (/)

--001a1140cd06cd51e00526cbfd3e
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

I assume you meant `tty-color-mode-alist'.  After running `emacs -Q' with
TERM set to `xterm-256color`, I see

tty-color-mode-alist is a variable defined in =E2=80=98tty-colors.el=E2=80=
=99.
Its value is ((never . -1)
 (no . -1)
 (default . 0)
 (auto . 0)
 (ansi8 . 8)
 (always . 8)
 (yes . 8))

After the client frame is created, it's the same.

`terminal-init-xterm` does indeed run when I create the client frame, but
as you can see, it doesn't modify tty-color-mode-alist.


On Sun, Dec 13, 2015 at 10:37 AM Eli Zaretskii <eliz@HIDDEN> wrote:

> > Date: Sun, 13 Dec 2015 20:17:11 +0200
> > From: Eli Zaretskii <eliz@HIDDEN>
> > Cc: 22154 <at> debbugs.gnu.org
> >
> > > From: Eric Hanchrow <eric.hanchrow@HIDDEN>
> > > Date: Sun, 13 Dec 2015 10:05:20 -0800
> > > Cc: 22154 <at> debbugs.gnu.org
> > >
> > >     Does the patch below fix the problem?
> > >
> > > It doesn't seem to make any difference.
> >
> > Strange, it did make a difference on my system.
> >
> > I guess I will then have to ask you to step in a debugger through
> > set_tty_color_mode and tty_setup_colors, and tell what is stored in
> > the default_* members of the tty object during the main Emacs
> > initialization and when the client frame is created.  I have no access
> > to a system with a 256-color xterm.
>
> It could also be tty-color-alist.  Can you tell me what's in it after
> Emacs starts on a 256-color xterm, and after the client frame is
> created?  Also, does xterm.el initialization get called for the client
> frame, and does it modify tty-color-alist?
>
>

--001a1140cd06cd51e00526cbfd3e
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I assume you meant `tty-color-mode-alist&#39;.=C2=A0 After=
 running `emacs -Q&#39; with TERM set to `xterm-256color`, I see<div><br></=
div><div><div>tty-color-mode-alist is a variable defined in =E2=80=98tty-co=
lors.el=E2=80=99.</div><div>Its value is ((never . -1)</div><div>=C2=A0(no =
. -1)</div><div>=C2=A0(default . 0)</div><div>=C2=A0(auto . 0)</div><div>=
=C2=A0(ansi8 . 8)</div><div>=C2=A0(always . 8)</div><div>=C2=A0(yes . 8))</=
div></div><div><br></div><div>After the client frame is created, it&#39;s t=
he same.</div><div><br></div><div>`terminal-init-xterm` does indeed run whe=
n I create the client frame, but as you can see, it doesn&#39;t modify tty-=
color-mode-alist.<br></div><div><br></div></div><br><div class=3D"gmail_quo=
te"><div dir=3D"ltr">On Sun, Dec 13, 2015 at 10:37 AM Eli Zaretskii &lt;<a =
href=3D"mailto:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquo=
te class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc so=
lid;padding-left:1ex">&gt; Date: Sun, 13 Dec 2015 20:17:11 +0200<br>
&gt; From: Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN" target=3D"_bla=
nk">eliz@HIDDEN</a>&gt;<br>
&gt; Cc: <a href=3D"mailto:22154 <at> debbugs.gnu.org" target=3D"_blank">22154@d=
ebbugs.gnu.org</a><br>
&gt;<br>
&gt; &gt; From: Eric Hanchrow &lt;<a href=3D"mailto:eric.hanchrow@HIDDEN=
" target=3D"_blank">eric.hanchrow@HIDDEN</a>&gt;<br>
&gt; &gt; Date: Sun, 13 Dec 2015 10:05:20 -0800<br>
&gt; &gt; Cc: <a href=3D"mailto:22154 <at> debbugs.gnu.org" target=3D"_blank">22=
154 <at> debbugs.gnu.org</a><br>
&gt; &gt;<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0Does the patch below fix the problem?<br>
&gt; &gt;<br>
&gt; &gt; It doesn&#39;t seem to make any difference.<br>
&gt;<br>
&gt; Strange, it did make a difference on my system.<br>
&gt;<br>
&gt; I guess I will then have to ask you to step in a debugger through<br>
&gt; set_tty_color_mode and tty_setup_colors, and tell what is stored in<br=
>
&gt; the default_* members of the tty object during the main Emacs<br>
&gt; initialization and when the client frame is created.=C2=A0 I have no a=
ccess<br>
&gt; to a system with a 256-color xterm.<br>
<br>
It could also be tty-color-alist.=C2=A0 Can you tell me what&#39;s in it af=
ter<br>
Emacs starts on a 256-color xterm, and after the client frame is<br>
created?=C2=A0 Also, does xterm.el initialization get called for the client=
<br>
frame, and does it modify tty-color-alist?<br>
<br>
</blockquote></div>

--001a1140cd06cd51e00526cbfd3e--




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

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


Received: (at 22154) by debbugs.gnu.org; 13 Dec 2015 18:37:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 13 13:37:27 2015
Received: from localhost ([127.0.0.1]:50481 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8BWR-0004Is-05
	for submit <at> debbugs.gnu.org; Sun, 13 Dec 2015 13:37:27 -0500
Received: from eggs.gnu.org ([208.118.235.92]:45377)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <eliz@HIDDEN>) id 1a8BWP-0004Ig-Ti
 for 22154 <at> debbugs.gnu.org; Sun, 13 Dec 2015 13:37:26 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1a8BWG-0001kM-Ob
 for 22154 <at> debbugs.gnu.org; Sun, 13 Dec 2015 13:37:20 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42299)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1a8BWG-0001kI-LZ; Sun, 13 Dec 2015 13:37:16 -0500
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3320
 helo=HOME-C4E4A596F7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1a8BWF-0006vY-UF; Sun, 13 Dec 2015 13:37:16 -0500
Date: Sun, 13 Dec 2015 20:37:26 +0200
Message-Id: <83poya42l5.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: eric.hanchrow@HIDDEN
In-reply-to: <83si3643iw.fsf@HIDDEN> (message from Eli Zaretskii on Sun, 13
 Dec 2015 20:17:11 +0200)
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN>
 <CAHZoxq_vMcb6UmHoS=QktU2Muhi2zC+z4htcsdR-KQQ9Sp8PGw@HIDDEN>
 <83si3643iw.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 22154
Cc: 22154 <at> debbugs.gnu.org
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>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Date: Sun, 13 Dec 2015 20:17:11 +0200
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: 22154 <at> debbugs.gnu.org
> 
> > From: Eric Hanchrow <eric.hanchrow@HIDDEN>
> > Date: Sun, 13 Dec 2015 10:05:20 -0800
> > Cc: 22154 <at> debbugs.gnu.org
> > 
> >     Does the patch below fix the problem?
> > 
> > It doesn't seem to make any difference. 
> 
> Strange, it did make a difference on my system.
> 
> I guess I will then have to ask you to step in a debugger through
> set_tty_color_mode and tty_setup_colors, and tell what is stored in
> the default_* members of the tty object during the main Emacs
> initialization and when the client frame is created.  I have no access
> to a system with a 256-color xterm.

It could also be tty-color-alist.  Can you tell me what's in it after
Emacs starts on a 256-color xterm, and after the client frame is
created?  Also, does xterm.el initialization get called for the client
frame, and does it modify tty-color-alist?





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

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


Received: (at 22154) by debbugs.gnu.org; 13 Dec 2015 18:17:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 13 13:17:13 2015
Received: from localhost ([127.0.0.1]:50450 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8BCq-0002A0-Tt
	for submit <at> debbugs.gnu.org; Sun, 13 Dec 2015 13:17:13 -0500
Received: from eggs.gnu.org ([208.118.235.92]:40439)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <eliz@HIDDEN>) id 1a8BCp-00029n-AS
 for 22154 <at> debbugs.gnu.org; Sun, 13 Dec 2015 13:17:11 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1a8BCf-0005Vr-CP
 for 22154 <at> debbugs.gnu.org; Sun, 13 Dec 2015 13:17:06 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42081)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1a8BCf-0005Vk-99; Sun, 13 Dec 2015 13:17:01 -0500
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3280
 helo=HOME-C4E4A596F7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1a8BCe-0007tb-KY; Sun, 13 Dec 2015 13:17:01 -0500
Date: Sun, 13 Dec 2015 20:17:11 +0200
Message-Id: <83si3643iw.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eric Hanchrow <eric.hanchrow@HIDDEN>
In-reply-to: <CAHZoxq_vMcb6UmHoS=QktU2Muhi2zC+z4htcsdR-KQQ9Sp8PGw@HIDDEN>
 (message from Eric Hanchrow on Sun, 13 Dec 2015 10:05:20 -0800)
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN>
 <CAHZoxq_vMcb6UmHoS=QktU2Muhi2zC+z4htcsdR-KQQ9Sp8PGw@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 22154
Cc: 22154 <at> debbugs.gnu.org
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>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Eric Hanchrow <eric.hanchrow@HIDDEN>
> Date: Sun, 13 Dec 2015 10:05:20 -0800
> Cc: 22154 <at> debbugs.gnu.org
> 
>     Does the patch below fix the problem?
> 
> It doesn't seem to make any difference. 

Strange, it did make a difference on my system.

I guess I will then have to ask you to step in a debugger through
set_tty_color_mode and tty_setup_colors, and tell what is stored in
the default_* members of the tty object during the main Emacs
initialization and when the client frame is created.  I have no access
to a system with a 256-color xterm.




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

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


Received: (at 22154) by debbugs.gnu.org; 13 Dec 2015 18:05:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 13 13:05:47 2015
Received: from localhost ([127.0.0.1]:50426 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8B1m-0001rB-Rb
	for submit <at> debbugs.gnu.org; Sun, 13 Dec 2015 13:05:47 -0500
Received: from mail-io0-f171.google.com ([209.85.223.171]:33238)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <eric.hanchrow@HIDDEN>) id 1a8B1l-0001qz-Rr
 for 22154 <at> debbugs.gnu.org; Sun, 13 Dec 2015 13:05:46 -0500
Received: by iow186 with SMTP id 186so4864070iow.0
 for <22154 <at> debbugs.gnu.org>; Sun, 13 Dec 2015 10:05:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc:content-type;
 bh=jdWvDKjgYYVVuoi9GcSHUHi9gv44GYdt3GwUv+z+SW8=;
 b=DCcTbRcPoqQSJEw4LNXbHV7WpY/KM8pmdcnC9bQMvyyeJxsq7pjr8h1DSbpS5MK1M0
 qYsfRQ398QXeS+ZXaYD9mmn3FrmdcbrApQL/C2J62cRzuWEeBbuJCTP65eUBmZCDQypG
 7TO8EpNfmBwfqoA6OWZSQlzt3NzwADLoPJMhL/8geTlGw8Q9DJLv7p/SLnl4f8obYcpo
 9x9LrFeEk74FIdA/Sk0/KvQoWN+gNR6kaSGVSBmf9QwdvNoGF112t3GttXs27nUn7Qx5
 eY9xeAdrkRtBNxcVwirM58TUpUnvo4I3MUfr3peZ6Yh+RwqTne97+TbsplCchdJ7PQKZ
 Yodw==
X-Received: by 10.107.130.82 with SMTP id e79mr30680761iod.77.1450029940370;
 Sun, 13 Dec 2015 10:05:40 -0800 (PST)
MIME-Version: 1.0
Received: by 10.64.27.2 with HTTP; Sun, 13 Dec 2015 10:05:20 -0800 (PST)
In-Reply-To: <8361025k9u.fsf@HIDDEN>
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 <8361025k9u.fsf@HIDDEN>
From: Eric Hanchrow <eric.hanchrow@HIDDEN>
Date: Sun, 13 Dec 2015 10:05:20 -0800
Message-ID: <CAHZoxq_vMcb6UmHoS=QktU2Muhi2zC+z4htcsdR-KQQ9Sp8PGw@HIDDEN>
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary=001a113f275c8275f80526cb6787
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 22154
Cc: 22154 <at> debbugs.gnu.org
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.7 (/)

--001a113f275c8275f80526cb6787
Content-Type: text/plain; charset=UTF-8

On Sun, Dec 13, 2015 at 9:30 AM Eli Zaretskii <eliz@HIDDEN> wrote:

>
> Out of curiosity: why would you want to downgrade the number of colors
> in the client frames wrt the number supported by the server?
>

It wasn't intentional.  I was trying out a new terminal (a
"terminal-in-your-browser" feature that's part of the "Jupyter notebook" (
http://jupyter.org/).  I created one of those terminals on the machine on
which I was running emacs, and, in order to see it work, I started an
emacsclient.

>
> Does the patch below fix the problem?
>

It doesn't seem to make any difference.

--001a113f275c8275f80526cb6787
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Sun, Dec 13=
, 2015 at 9:30 AM Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN" target=
=3D"_blank">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gmail=
_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:=
1ex"><br>
Out of curiosity: why would you want to downgrade the number of colors<br>
in the client frames wrt the number supported by the server?<br></blockquot=
e><div><br></div><div>It wasn&#39;t intentional.=C2=A0 I was trying out a n=
ew terminal (a &quot;terminal-in-your-browser&quot; feature that&#39;s part=
 of the &quot;Jupyter notebook&quot; (<a href=3D"http://jupyter.org/" targe=
t=3D"_blank">http://jupyter.org/</a>).=C2=A0 I created one of those termina=
ls on the machine on which I was running emacs, and, in order to see it wor=
k, I started an emacsclient.=C2=A0</div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>Does the patch below fix the problem?<br></blockquote><div><br></div><d=
iv>It doesn&#39;t seem to make any difference.=C2=A0</div></div></div>

--001a113f275c8275f80526cb6787--




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

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


Received: (at 22154) by debbugs.gnu.org; 13 Dec 2015 17:30:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 13 12:30:06 2015
Received: from localhost ([127.0.0.1]:50353 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8ATF-0007lQ-Uc
	for submit <at> debbugs.gnu.org; Sun, 13 Dec 2015 12:30:06 -0500
Received: from eggs.gnu.org ([208.118.235.92]:59560)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <eliz@HIDDEN>) id 1a8ATE-0007jk-8Z
 for 22154 <at> debbugs.gnu.org; Sun, 13 Dec 2015 12:30:04 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1a8AT6-0003Mh-3a
 for 22154 <at> debbugs.gnu.org; Sun, 13 Dec 2015 12:29:59 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41603)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1a8AT5-0003Md-WB; Sun, 13 Dec 2015 12:29:56 -0500
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3133
 helo=HOME-C4E4A596F7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1a8AT5-0003zY-7X; Sun, 13 Dec 2015 12:29:55 -0500
Date: Sun, 13 Dec 2015 19:30:05 +0200
Message-Id: <8361025k9u.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eric Hanchrow <eric.hanchrow@HIDDEN>
In-reply-to: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
 (message from Eric Hanchrow on Sat, 12 Dec 2015 21:49:10 +0000)
Subject: Re: bug#22154: 25.0.50;
 emacsclient -c "breaks" 256-color display in server
References: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 22154
Cc: 22154 <at> debbugs.gnu.org
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>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Eric Hanchrow <eric.hanchrow@HIDDEN>
> Date: Sat, 12 Dec 2015 21:49:10 +0000
> 
> I have TERM set to 'xterm-256color'.
> 
> I started emacs with `/mnt/emacs-25/src/emacs -Q`
> 
> I confirmed that 256 colors "worked" by doing M-x list-colors-display
> RET, and noting that there were about 256 lines of output, with plenty
> of different colors.
> 
> I typed M-x server-start RET.
> 
> In another terminal on the same machine, I typed `TERM=xterm
> /mnt/emacs-25/lib-src/emacsclient -c`. That displayed a *scratch*
> buffer, as I'd expected.

Out of curiosity: why would you want to downgrade the number of colors
in the client frames wrt the number supported by the server?

> In that new frame, I typed `M-x list-colors-display RET`. I noticed
> that now there were only eight lines of output.
> 
> I did C-x 5 0 to delete the new frame, then back in the original frame
> again typed `M-x list-colors-display RET`, and noted that there were
> still only eight lines of output.

This was never supported, we always assumed that the number of colors
on all tty frames is the same.

Does the patch below fix the problem?

diff --git a/src/term.c b/src/term.c
index 6ab611d..b7d9d5c 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2041,16 +2041,6 @@ TERMINAL does not refer to a text terminal.  */)
 
 #ifndef DOS_NT
 
-/* Declare here rather than in the function, as in the rest of Emacs,
-   to work around an HPUX compiler bug (?). See
-   http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00410.html  */
-static int default_max_colors;
-static int default_max_pairs;
-static int default_no_color_video;
-static char *default_orig_pair;
-static char *default_set_foreground;
-static char *default_set_background;
-
 /* Save or restore the default color-related capabilities of this
    terminal.  */
 static void
@@ -2059,21 +2049,21 @@ tty_default_color_capabilities (struct tty_display_info *tty, bool save)
 
   if (save)
     {
-      dupstring (&default_orig_pair, tty->TS_orig_pair);
-      dupstring (&default_set_foreground, tty->TS_set_foreground);
-      dupstring (&default_set_background, tty->TS_set_background);
-      default_max_colors = tty->TN_max_colors;
-      default_max_pairs = tty->TN_max_pairs;
-      default_no_color_video = tty->TN_no_color_video;
+      dupstring (&tty->default_orig_pair, tty->TS_orig_pair);
+      dupstring (&tty->default_set_foreground, tty->TS_set_foreground);
+      dupstring (&tty->default_set_background, tty->TS_set_background);
+      tty->default_max_colors = tty->TN_max_colors;
+      tty->default_max_pairs = tty->TN_max_pairs;
+      tty->default_no_color_video = tty->TN_no_color_video;
     }
   else
     {
-      tty->TS_orig_pair = default_orig_pair;
-      tty->TS_set_foreground = default_set_foreground;
-      tty->TS_set_background = default_set_background;
-      tty->TN_max_colors = default_max_colors;
-      tty->TN_max_pairs = default_max_pairs;
-      tty->TN_no_color_video = default_no_color_video;
+      tty->TS_orig_pair = tty->default_orig_pair;
+      tty->TS_set_foreground = tty->default_set_foreground;
+      tty->TS_set_background = tty->default_set_background;
+      tty->TN_max_colors = tty->default_max_colors;
+      tty->TN_max_pairs = tty->default_max_pairs;
+      tty->TN_no_color_video = tty->default_no_color_video;
     }
 }
 
@@ -4131,6 +4121,7 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\
     }
 
   tty_default_color_capabilities (tty, 1);
+  tty->previous_color_mode = -1;
 
   MagicWrap (tty) = tgetflag ("xn");
   /* Since we make MagicWrap terminals look like AutoWrap, we need to have
@@ -4496,12 +4487,6 @@ bigger, or it may make it blink, or it may do nothing at all.  */);
   defsubr (&Sgpm_mouse_stop);
 #endif /* HAVE_GPM */
 
-#ifndef DOS_NT
-  default_orig_pair = NULL;
-  default_set_foreground = NULL;
-  default_set_background = NULL;
-#endif /* !DOS_NT */
-
   encode_terminal_src = NULL;
   encode_terminal_dst = NULL;
 
diff --git a/src/termchar.h b/src/termchar.h
index 06c0427..b07b78f 100644
--- a/src/termchar.h
+++ b/src/termchar.h
@@ -161,6 +161,14 @@ struct tty_display_info
   const char *TS_set_foreground;
   const char *TS_set_background;
 
+  /* Default values recorded when the tty was initialized.  */
+  char *default_orig_pair;
+  char *default_set_foreground;
+  char *default_set_background;
+  int default_max_colors;
+  int default_max_pairs;
+  int default_no_color_video;
+
   int TF_hazeltine;             /* termcap hz flag. */
   int TF_insmode_motion;        /* termcap mi flag: can move while in insert mode. */
   int TF_standout_motion;       /* termcap mi flag: can move while in standout mode. */




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

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


Received: (at submit) by debbugs.gnu.org; 12 Dec 2015 21:49:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 12 16:49:33 2015
Received: from localhost ([127.0.0.1]:49764 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a7s2m-0004Is-L1
	for submit <at> debbugs.gnu.org; Sat, 12 Dec 2015 16:49:32 -0500
Received: from eggs.gnu.org ([208.118.235.92]:53129)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <eric.hanchrow@HIDDEN>) id 1a7s2k-0004Ig-Mb
 for submit <at> debbugs.gnu.org; Sat, 12 Dec 2015 16:49:31 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eric.hanchrow@HIDDEN>) id 1a7s2e-0007aZ-3u
 for submit <at> debbugs.gnu.org; Sat, 12 Dec 2015 16:49:25 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:38241)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <eric.hanchrow@HIDDEN>) id 1a7s2e-0007aV-1g
 for submit <at> debbugs.gnu.org; Sat, 12 Dec 2015 16:49:24 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:34891)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <eric.hanchrow@HIDDEN>) id 1a7s2c-0004mW-Kl
 for bug-gnu-emacs@HIDDEN; Sat, 12 Dec 2015 16:49:23 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eric.hanchrow@HIDDEN>) id 1a7s2b-0007a5-9k
 for bug-gnu-emacs@HIDDEN; Sat, 12 Dec 2015 16:49:22 -0500
Received: from mail-ig0-x22b.google.com ([2607:f8b0:4001:c05::22b]:38317)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <eric.hanchrow@HIDDEN>) id 1a7s2b-0007a1-3z
 for bug-gnu-emacs@HIDDEN; Sat, 12 Dec 2015 16:49:21 -0500
Received: by igbxm8 with SMTP id xm8so61266110igb.1
 for <bug-gnu-emacs@HIDDEN>; Sat, 12 Dec 2015 13:49:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:from:date:message-id:subject:to:content-type;
 bh=NXHyZx7lGMrMSqduqJIZ/Bx0R9a/Dt0mqJk3dQYggrI=;
 b=rhf4zudO/L/3B3DFO/6R2sGQxn/3Jn6HbGaRrBycgH8jbHXAb6zfO9mgqG/yoOclpa
 WqsZwKCvmk8jsEJsn55LpqJAUZHqaYnSR7u43TRdfEkBniRWKNonhj/7BNJCpZy9ITuc
 InO0e+ASnHwnzlejfkLGM2861MJ3Ygiw5znZ1cbWL9UjwI3mXvA/okQ6OLEW6VnlQF4i
 AIB+XmjSx1BhLsKbzkHcJu5u5WgH8USadZ+brPxfAjw7CFXasp1IJXQ72eTVPX4Z03yU
 sc/XUhDLH6UY/FEy/6TkKNkfK4KnXgQHtxU/BuMZYPIpBz5VwJTA9Ql14hbIdOi/jlhc
 iWDQ==
X-Received: by 10.50.155.35 with SMTP id vt3mr11049519igb.28.1449956960215;
 Sat, 12 Dec 2015 13:49:20 -0800 (PST)
MIME-Version: 1.0
From: Eric Hanchrow <eric.hanchrow@HIDDEN>
Date: Sat, 12 Dec 2015 21:49:10 +0000
Message-ID: <CAHZoxq_z=XcuBZ2XN3GCuj54ctiAeWRPQ6vF_6VX=Ukgm9SQ-A@HIDDEN>
Subject: 25.0.50; emacsclient -c "breaks" 256-color display in server
To: "bug-gnu-emacs@HIDDEN" <bug-gnu-emacs@HIDDEN>
Content-Type: multipart/alternative; boundary=001a1130ce4c8daa860526ba6936
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
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: -4.0 (----)

--001a1130ce4c8daa860526ba6936
Content-Type: text/plain; charset=UTF-8

I have TERM set to 'xterm-256color'.

I started emacs with `/mnt/emacs-25/src/emacs -Q`

I confirmed that 256 colors "worked" by doing M-x list-colors-display
RET, and noting that there were about 256 lines of output, with plenty
of different colors.

I typed M-x server-start RET.

In another terminal on the same machine, I typed `TERM=xterm
/mnt/emacs-25/lib-src/emacsclient -c`.  That displayed a *scratch*
buffer, as I'd expected.

In that new frame, I typed `M-x list-colors-display RET`.  I noticed
that now there were only eight lines of output.

I did C-x 5 0 to delete the new frame, then back in the original frame
again typed `M-x list-colors-display RET`, and noted that there were
still only eight lines of output.

I don't directly care about the number of output lines from the
list-colors-display command, but I do directly care that, for example,
the face "brightyellow" looks different from the default; that's the
case when 256 colors are "working", but not when they're not.  It was



In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu)
 of 2015-12-10
Repository revision: a1e076240c71373954de0579bf4b026891df8a98
Configured using:
 'configure --enable-checking --config-cache 'CFLAGS=-O0 -g3''

Configured features:
SOUND NOTIFY LIBSELINUX LIBXML2 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Help

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Unable to load color "color-27" [2 times]
Unable to load color "color-28" [2 times]
Unable to load color "color-29" [2 times]
Unable to load color "color-30" [2 times]
Unable to load color "color-31" [2 times]
Unable to load color "color-32" [2 times]
Unable to load color "color-33" [2 times]
When done with this frame, type C-x 5 0
Type C-x 1 to delete the help window.


Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message dired format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail regexp-opt rfc2047 rfc2045
ietf-drums mm-util help-fns mail-prsvr mail-utils color server
term/xterm xterm byte-opt gv bytecomp byte-compile cl-extra help-mode
easymenu cl-loaddefs pcase cl-lib cconv time-date mule-util tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select mouse jit-lock font-lock syntax
facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp
files text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote inotify multi-tty
make-network-process emacs)

Memory information:
((conses 16 120356 5071)
 (symbols 48 27849 0)
 (miscs 40 36 100)
 (strings 32 31989 4591)
 (string-bytes 1 581177)
 (vectors 16 10614)
 (vector-slots 8 389733 2151)
 (floats 8 267 501)
 (intervals 56 231 96)
 (buffers 976 13)
 (heap 1024 21302 815))

--001a1130ce4c8daa860526ba6936
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>I have TERM set to &#39;xterm-256color&#39;.<br></div=
><div><br></div><div>I started emacs with `/mnt/emacs-25/src/emacs -Q`</div=
><div><br></div><div>I confirmed that 256 colors &quot;worked&quot; by doin=
g M-x list-colors-display</div><div>RET, and noting that there were about 2=
56 lines of output, with plenty</div><div>of different colors.</div><div><b=
r></div><div>I typed M-x server-start RET.</div><div><br></div><div>In anot=
her terminal on the same machine, I typed `TERM=3Dxterm</div><div>/mnt/emac=
s-25/lib-src/emacsclient -c`.=C2=A0 That displayed a *scratch*</div><div>bu=
ffer, as I&#39;d expected.</div><div><br></div><div>In that new frame, I ty=
ped `M-x list-colors-display RET`.=C2=A0 I noticed</div><div>that now there=
 were only eight lines of output.</div><div><br></div><div>I did C-x 5 0 to=
 delete the new frame, then back in the original frame</div><div>again type=
d `M-x list-colors-display RET`, and noted that there were</div><div>still =
only eight lines of output.</div><div><br></div><div>I don&#39;t directly c=
are about the number of output lines from the</div><div>list-colors-display=
 command, but I do directly care that, for example,</div><div>the face &quo=
t;brightyellow&quot; looks different from the default; that&#39;s the</div>=
<div>case when 256 colors are &quot;working&quot;, but not when they&#39;re=
 not.=C2=A0 It was=C2=A0</div><div><br></div><div><br></div><div><br></div>=
<div>In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu)</div><div>=C2=A0of 2=
015-12-10</div><div>Repository revision: a1e076240c71373954de0579bf4b026891=
df8a98</div><div>Configured using:</div><div>=C2=A0&#39;configure --enable-=
checking --config-cache &#39;CFLAGS=3D-O0 -g3&#39;&#39;</div><div><br></div=
><div>Configured features:</div><div>SOUND NOTIFY LIBSELINUX LIBXML2 ZLIB</=
div><div><br></div><div>Important settings:</div><div>=C2=A0 value of $LANG=
: en_US.UTF-8</div><div>=C2=A0 locale-coding-system: utf-8-unix</div><div><=
br></div><div>Major mode: Help</div><div><br></div><div>Minor modes in effe=
ct:</div><div>=C2=A0 tooltip-mode: t</div><div>=C2=A0 global-eldoc-mode: t<=
/div><div>=C2=A0 electric-indent-mode: t</div><div>=C2=A0 menu-bar-mode: t<=
/div><div>=C2=A0 file-name-shadow-mode: t</div><div>=C2=A0 global-font-lock=
-mode: t</div><div>=C2=A0 font-lock-mode: t</div><div>=C2=A0 auto-compositi=
on-mode: t</div><div>=C2=A0 auto-encryption-mode: t</div><div>=C2=A0 auto-c=
ompression-mode: t</div><div>=C2=A0 buffer-read-only: t</div><div>=C2=A0 li=
ne-number-mode: t</div><div>=C2=A0 transient-mark-mode: t</div><div><br></d=
iv><div>Recent messages:</div><div>Unable to load color &quot;color-27&quot=
; [2 times]</div><div>Unable to load color &quot;color-28&quot; [2 times]</=
div><div>Unable to load color &quot;color-29&quot; [2 times]</div><div>Unab=
le to load color &quot;color-30&quot; [2 times]</div><div>Unable to load co=
lor &quot;color-31&quot; [2 times]</div><div>Unable to load color &quot;col=
or-32&quot; [2 times]</div><div>Unable to load color &quot;color-33&quot; [=
2 times]</div><div>When done with this frame, type C-x 5 0</div><div>Type C=
-x 1 to delete the help window.</div><div><br></div><div><br></div><div>Loa=
d-path shadows:</div><div>None found.</div><div><br></div><div>Features:</d=
iv><div>(shadow sort gnus-util mail-extr emacsbug message dired format-spec=
</div><div>rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2=
231</div><div>mailabbrev gmm-utils mailheader sendmail regexp-opt rfc2047 r=
fc2045</div><div>ietf-drums mm-util help-fns mail-prsvr mail-utils color se=
rver</div><div>term/xterm xterm byte-opt gv bytecomp byte-compile cl-extra =
help-mode</div><div>easymenu cl-loaddefs pcase cl-lib cconv time-date mule-=
util tooltip</div><div>eldoc electric uniquify ediff-hook vc-hooks lisp-flo=
at-type</div><div>tabulated-list newcomment elisp-mode lisp-mode prog-mode =
register page</div><div>menu-bar rfn-eshadow timer select mouse jit-lock fo=
nt-lock syntax</div><div>facemenu font-core frame cl-generic cham georgian =
utf-8-lang misc-lang</div><div>vietnamese tibetan thai tai-viet lao korean =
japanese eucjp-ms cp51932</div><div>hebrew greek romanian slovak czech euro=
pean ethiopic indian cyrillic</div><div>chinese charscript case-table epa-h=
ook jka-cmpr-hook help simple abbrev</div><div>minibuffer cl-preloaded nadv=
ice loaddefs button faces cus-face macroexp</div><div>files text-properties=
 overlay sha1 md5 base64 format env code-pages mule</div><div>custom widget=
 hashtable-print-readable backquote inotify multi-tty</div><div>make-networ=
k-process emacs)</div><div><br></div><div>Memory information:</div><div>((c=
onses 16 120356 5071)</div><div>=C2=A0(symbols 48 27849 0)</div><div>=C2=A0=
(miscs 40 36 100)</div><div>=C2=A0(strings 32 31989 4591)</div><div>=C2=A0(=
string-bytes 1 581177)</div><div>=C2=A0(vectors 16 10614)</div><div>=C2=A0(=
vector-slots 8 389733 2151)</div><div>=C2=A0(floats 8 267 501)</div><div>=
=C2=A0(intervals 56 231 96)</div><div>=C2=A0(buffers 976 13)</div><div>=C2=
=A0(heap 1024 21302 815))</div><div><br></div></div>

--001a1130ce4c8daa860526ba6936--




Acknowledgement sent to Eric Hanchrow <eric.hanchrow@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#22154; 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: Fri, 18 Dec 2015 05:15:01 UTC

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