From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id 4E4783858C1F for ; Tue, 19 Sep 2023 14:13:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4E4783858C1F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from eig-obgw-6008a.ext.cloudfilter.net ([10.0.30.227]) by cmsmtp with ESMTP id ib4Mq0BNuQFHRibTcqKE6y; Tue, 19 Sep 2023 14:13:20 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id ibTbqCPMW5YsYibTbqjpxY; Tue, 19 Sep 2023 14:13:19 +0000 X-Authority-Analysis: v=2.4 cv=N786qkxB c=1 sm=1 tr=0 ts=6509ac7f a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=zNV7Rl7Rt7sA:10 a=Qbun_eYptAEA:10 a=CCpqsmhAAAAA:8 a=zstS-IiYAAAA:8 a=RShPybgiAAAA:8 a=AHULSLDt9wU0B5Vi2e8A:9 a=S_HVFEA2qnQA:10 a=ul9cdbp4aOFLsgKbc677:22 a=4G6NA9xxw8l3yy4pmD5M:22 a=YLGRqFcrAwIahUk1acIU:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=u6t60XZnTn117xfG/rVk9muSXUemEIi1ytA2jE8oepw=; b=Vl8LRyjvI1jYuxsO0/h5picgKr TCzwLc8v2hD12o9FnBmHfojJB4NGbHgfj/y9vJQ0BaVlNPjimCqcPd7PQb8wWuiRnWPLETyTqxVzE qC6cnbnnQBtS/j6YjQvYkrEBs; Received: from 71-211-130-31.hlrn.qwest.net ([71.211.130.31]:55064 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qibTa-002Ozr-2M; Tue, 19 Sep 2023 08:13:18 -0600 From: Tom Tromey To: Andrew Burgess via Gdb-patches Cc: Tom Tromey , Andrew Burgess Subject: Re: [PATCH] Support the NO_COLOR environment variable References: <20230916000908.110459-1-tom@tromey.com> <87h6nrztkl.fsf@redhat.com> X-Attribution: Tom Date: Tue, 19 Sep 2023 08:13:17 -0600 In-Reply-To: <87h6nrztkl.fsf@redhat.com> (Andrew Burgess via Gdb-patches's message of "Mon, 18 Sep 2023 11:03:54 +0100") Message-ID: <87a5ti8d4y.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.211.130.31 X-Source-L: No X-Exim-ID: 1qibTa-002Ozr-2M X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-130-31.hlrn.qwest.net (murgatroyd) [71.211.130.31]:55064 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfLlwXwZf31/oOZ6zyTZ4jRYFgqEE5P8N75kQZm92M2nARVzx9DXyjgFtih/x7uDkGRQ6X3EeUFIqOD/YmygYCkm0gN3q15bUx+62eVrVvljSdGjHVfG9 xVpMPmxq1vK4/4YeCSUH42Z6ArZe5pmn87jL2N93DtAApe32SaAd5rIE97vrRx3rUiJgar87b3hDGDaOSdkT8EhEpcYpBJV0pMk= X-Spam-Status: No, score=-3019.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Andrew" == Andrew Burgess via Gdb-patches writes: Andrew> Tom Tromey writes: >> I ran across this site: >> >> https://no-color.org/ >> >> ... which lobbies for tools to recognize the NO_COLOR environment >> variable and disable any terminal styling when it is seen. Andrew> I've never understood the passionate hatred some folk have for coloured Andrew> output! But NO_COLOR sounds like a fairly reasonable request, so I'm in Andrew> favour of adding this. I did have some thoughts on the testing... Me neither but it seems pretty simple to accommodate them. >> - if {$dumb_terminal} { >> - clean_restart $binfile >> - } else { >> - Term::clean_restart 24 80 $binfile >> - if {![Term::prepare_for_tui]} { >> - unsupported "TUI not supported" >> - return >> + global env >> + save_vars { env(TERM) } { >> + setenv TERM $terminal >> + if {$dumb_terminal} { >> + clean_restart $binfile >> + } else { >> + Term::clean_restart 24 80 $binfile >> + if {![Term::prepare_for_tui]} { >> + unsupported "TUI not supported" >> + return >> + } Andrew> I'm not sure that this change is needed. Something is needed here, because without this there are regressions. Tom