From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id B22083858D33 for ; Sat, 16 Sep 2023 08:39:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B22083858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-53482b44007so2169318a12.2 for ; Sat, 16 Sep 2023 01:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694853585; x=1695458385; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8KsdP5tqpsWSVj0mv8iTLNE3wthyHJB17HoyHLL5dus=; b=ncU0Ee8uauOIx8E5Xq68AeSp4Ktwu6o2WyPi2eelBp6b1+YUOnsDHAXBzEvV9px86/ +v0oGvXv4Tbf5DyiezXv9Cv202wR4U3gkaf/A7k/jr0SuFoRRKjTUSfmzKQkmPn49hQ7 5VqYOMTWgkOPHJvIRU2/Trqul4JkrnymKXKn8RnrWAmkIDSHQMe/hMNwxbGyhubWszDr zK8FFL8e7IVe4bLufH86GM7rwWTVkqsPX7LUPCddfnbiaDXRcDUL0D/DiBQ+tbTttbZw g15jRScYqwId+rpcPxPhYwmjR5Fp8LaXGUjdnd8K7u9FjnXvhX85WvPb/rLsoJ5cTtU+ uS4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694853585; x=1695458385; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8KsdP5tqpsWSVj0mv8iTLNE3wthyHJB17HoyHLL5dus=; b=RCFEOfLJP9zxlRUDCpI9txfKkpYvg84INlyh/YZCYxvRme2zeUAOjQzq4aKCS/noVy wZ/OejXED+cWv6QKcFR7AnCZpPVyP3tFPn+LF8/FL8wtqrp4wVKTPFCnAF2QyR4eTzT7 osnCiNdoUs6sjkEJ2F0gaWRf1lccpxiltZUm1D6dBUfDzpBB2j1IPqcR1nJyXYQNe1Io OmTOBu5sycXCteE2SRCQkzyHRAW3nFhWdsnOP7AJidb6Ak+5XXQ0iaAyARKObVqCU1dA Tz2tANZ8h2/Kc8uqYOOkRUmq8fv1gRFrtpU1bdgMUEDwed+CogVC2uPLP8q4Q4ZToy6U D/Vw== X-Gm-Message-State: AOJu0YzQzMYXYN5eFFbqOM5o86BPasykVz72S0NU9l9KFX/dy4F/dBxx B8JESeS+wKuQxUpThdSg7KuwXebbLUrlMkgJPH193y7Ohq7tEQ== X-Google-Smtp-Source: AGHT+IGLT1ZwevRPYkMAfPwJjVerBUBGD23ikpjNgliVfBPekBC0ISg7WinZmTSCQMCYEm0FNC21mUpcBA3IIkQpZBU= X-Received: by 2002:a17:90b:3004:b0:269:25a8:66c with SMTP id hg4-20020a17090b300400b0026925a8066cmr3289302pjb.45.1694853585565; Sat, 16 Sep 2023 01:39:45 -0700 (PDT) MIME-Version: 1.0 References: <20230916000908.110459-1-tom@tromey.com> <83bke2k7fa.fsf@gnu.org> In-Reply-To: <83bke2k7fa.fsf@gnu.org> From: Matt Rice Date: Sat, 16 Sep 2023 08:39:34 +0000 Message-ID: Subject: Re: [PATCH] Support the NO_COLOR environment variable To: Eli Zaretskii Cc: Tom Tromey , gdb-patches@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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: On Sat, Sep 16, 2023 at 5:35=E2=80=AFAM Eli Zaretskii via Gdb-patches wrote: > > > From: Tom Tromey > > Cc: Tom Tromey > > Date: Fri, 15 Sep 2023 18:09:08 -0600 > > 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. > > > > This patch implements this for gdb. > > Should we also support the --color command-line argument, e.g. to > countermand NO_COLOR in the environment, and also as an alternative to > the environment variable? > I'm not sure a specific --color command-line argument is necessary, the arg --early-init-eval-command 'set style enabled' (-eiex, which I noticed is missing from --help.) works even when NO_COLOR is set, appropriately printing colors in the non-quiet startup message. So even without something specific like --color it is possible to override the env var. IMO the need for specific commands for things we want to happen early like `--quiet` vs `-eiex 'set startup-quietly'` feel to me like holdovers from before early evaluation existed when a specific command line arg like `--quiet` needed early evaluation to have any effect. But perhaps that is just an opinion.