public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Tom Tromey <tom@tromey.com>,
	Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org>
Cc: Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH] Support the NO_COLOR environment variable
Date: Tue, 26 Sep 2023 14:48:49 +0100	[thread overview]
Message-ID: <875y3xxcxq.fsf@redhat.com> (raw)
In-Reply-To: <87a5ti8d4y.fsf@tromey.com>

Tom Tromey <tom@tromey.com> writes:

>>>>>> "Andrew" == Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org> writes:
>
> Andrew> Tom Tromey <tom@tromey.com> 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.

OK, yeah, I see what I missed now.

Thanks,
Andrew


  reply	other threads:[~2023-09-26 13:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-16  0:09 Tom Tromey
2023-09-16  5:34 ` Eli Zaretskii
2023-09-16  8:39   ` Matt Rice
2023-09-16  8:50     ` Eli Zaretskii
2023-09-19 14:11   ` Tom Tromey
2023-09-18 10:03 ` Andrew Burgess
2023-09-19 14:13   ` Tom Tromey
2023-09-26 13:48     ` Andrew Burgess [this message]
2024-01-04  0:38     ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875y3xxcxq.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).