From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Ruffing Newsgroups: gmane.emacs.bugs Subject: bug#44950: 28.0.50; 24-bit colors not used in terminal with emacsclient Date: Mon, 31 May 2021 16:06:55 +0200 Message-ID: References: <20201129165641.00308157@ventiloplattform.tastytea.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-6eQx8BKi+KmyCIfKKOCG" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19230"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44950@debbugs.gnu.org To: Eli Zaretskii , tastytea Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 31 17:07:39 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lnjVy-0004sV-Ie for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 May 2021 17:07:38 +0200 Original-Received: from localhost ([::1]:58112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnjVx-0006tb-7u for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 May 2021 11:07:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnjVQ-0006qu-NZ for bug-gnu-emacs@gnu.org; Mon, 31 May 2021 11:07:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lnjVP-0007SG-FJ for bug-gnu-emacs@gnu.org; Mon, 31 May 2021 11:07:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lnjVO-00055b-9y for bug-gnu-emacs@gnu.org; Mon, 31 May 2021 11:07:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <20201129165641.00308157@ventiloplattform.tastytea.de> Resent-From: Tim Ruffing Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 May 2021 15:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44950 X-GNU-PR-Package: emacs Original-Received: via spool by 44950-submit@debbugs.gnu.org id=B44950.162247357719489 (code B ref 44950); Mon, 31 May 2021 15:07:02 +0000 Original-Received: (at 44950) by debbugs.gnu.org; 31 May 2021 15:06:17 +0000 Original-Received: from localhost ([127.0.0.1]:34619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnjUd-00054F-Lg for submit@debbugs.gnu.org; Mon, 31 May 2021 11:06:17 -0400 Original-Received: from mout-p-201.mailbox.org ([80.241.56.171]:33816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lniZO-0003ZT-Sx for 44950@debbugs.gnu.org; Mon, 31 May 2021 10:07:08 -0400 Original-Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4FtxtX5lqkzQjkX; Mon, 31 May 2021 16:07:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timruffing.de; s=MBO0001; t=1622470018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=zpQHc5CbAJsnzayoKhBgOc/83b4uQcOu+aoTO/qu2WY=; b=tse/FnHa9hgir7rh2S6eO47lS+/PF4YijGxpNrsObmZjOm2NXfrMkjr/r30sYu8t/D25D9 pkyYg8ywpQR4JOsCVFBPGkw/opUxIPIyIjiE7ai7KjkjE+G7qrLXKLUC9EaCKyTQMfgvni Zmi1woGbtc/O0FunYH6n8Y7RJe9xiU4w11ujBsLVfOGNnmfmWleGPCwvA96zHxHQy6u2cM sUDiqH4HbAWd5wsPr8R54TXZjn2uGwR+z9buj2tA+XzrJn0G0+rgKOapYdmnyBUqKWyIKd oDnM6tMu1Rd72eAHGYR0RR2+wF0BnSfylmiQWLMiGjz+KButb+rgOAnP/f0lGA== Original-Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id jwzih7kj3Okf; Mon, 31 May 2021 16:06:57 +0200 (CEST) X-Rspamd-Score: -3.87 / 15.00 / 15.00 X-Rspamd-Queue-Id: 615441804 X-Rspamd-UID: 3aaab5 X-Mailman-Approved-At: Mon, 31 May 2021 11:06:15 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:207706 Archived-At: --=-6eQx8BKi+KmyCIfKKOCG Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit I think what tastytea is saying is that when emacs checks the env variable COLORTERM, it uses the environment of the server and not the one of emacsclient. And yes, that's just a bug. emacsclient should read that variable and pass it to server. But this requires new code because it breaks with the pattern of using terminfo to detect term support. So the terminfo detection is currently more reliable. Would you be willing to accept something like the attached patch? This will improve detection without relying on COLORTERM, which should make the situation already much better. Tc is in the terminfo of many terminals, see https://gist.github.com/XVilka/8346728 . If yes, I can send an improved patch (with added explanations to doc/misc/efaq.texi). Tim --=-6eQx8BKi+KmyCIfKKOCG Content-Disposition: attachment; filename*0=0001-Support-Tc-terminfo-flag-forg-24-bit-color-support-i.pat; filename*1=ch Content-Transfer-Encoding: base64 Content-Type: text/x-patch; name="0001-Support-Tc-terminfo-flag-forg-24-bit-color-support-i.patch"; charset="UTF-8" RnJvbSA4YzU4NTFhOTY0NDdjZDA2ZjQxZDI5ODMzOTBlNjk5NDYxODcwMDcyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBUaW0gUnVmZmluZyA8Y3J5cHRvQHRpbXJ1ZmZpbmcuZGU+CkRh dGU6IE1vbiwgMzEgTWF5IDIwMjEgMTU6Mzg6MTkgKzAyMDAKU3ViamVjdDogW1BBVENIXSBTdXBw b3J0IFRjIHRlcm1pbmZvIGZsYWcgZm9yZyAyNC1iaXQgY29sb3Igc3VwcG9ydCBpbgogdGVybWlu YWwKCi0tLQogc3JjL3Rlcm0uYyB8IDEwICsrKysrKy0tLS0KIDEgZmlsZSBjaGFuZ2VkLCA2IGlu c2VydGlvbnMoKyksIDQgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvc3JjL3Rlcm0uYyBiL3Ny Yy90ZXJtLmMKaW5kZXggYzk5NWE0NDk5Yy4uZmRjYzExNmI2OSAxMDA2NDQKLS0tIGEvc3JjL3Rl cm0uYworKysgYi9zcmMvdGVybS5jCkBAIC00MTU3LDEwICs0MTU3LDEyIEBAIGluaXRfdHR5IChj b25zdCBjaGFyICpuYW1lLCBjb25zdCBjaGFyICp0ZXJtaW5hbF90eXBlLCBib29sIG11c3Rfc3Vj Y2VlZCkKIAkgICAgICAgY291bGQgcmV0dXJuIDMyNzY3LiAgKi8KIA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