garden icon indicating copy to clipboard operation
garden copied to clipboard

[FEATURE]: Ability to disable colorised output

Open glennsarti opened this issue 3 years ago • 5 comments

Feature Request

Background / Motivation

Currently there doesn't appear to be a way to disable colourised output besides using a JSON/YAML output format. This can cause issues with terminals that don't fully support colourisation or font change e.g. italics. An example below

image

Admittedly the funny looking font is my terminal configuration (Default Windows Terminal with Cascadia Code Italics) but I cannot disable this "feature" in garden

It also causes issues in CI logging tools and spews out ANSI codes in log output.

What should the user be able to do?

There already exists a --log-level command line argument. I would like a --no-color argument as well to disable any fancy colouristation of output. Or perhaps an additional log-level of no-color which behave like basic but also have no colour.

This would also disable the ability to move the cursor easily using ANSI sequences so I'd expect this is an opt in setting.

Why do they want to do this? What problem does it solve?

If my terminal renders the "fancy" text incorrectly, I can quickly disable it so I can read the output of Garden

Suggested Implementation(s)

As above. either add --no-color or --log-level no-color

How important is this feature for you/your team?

🌵 Not having this feature makes using Garden painful

The rendered text is more difficult to read with a default install of Windows Terminal

glennsarti avatar May 31 '21 02:05 glennsarti

Hi @glennsarti

That's a very good point and should be simple to fix. We'll look into this right away.

eysi09 avatar Jun 01 '21 14:06 eysi09

There is actually an undocumented way to do this with an environment variable: FORCE_COLOR=0. But the feature request is still definitely legit, we should have a canonical + documented way to do this.

edvald avatar Jun 01 '21 15:06 edvald

One standard way to do this is TERM=dumb. It would be great if that setting disabled all ANSI tty output.

rogpeppe avatar Sep 02 '21 17:09 rogpeppe

This issue has been automatically marked as stale because it hasn't had any activity in 90 days. It will be closed in 14 days if no further activity occurs (e.g. changing labels, comments, commits, etc.). Please feel free to tag a maintainer and ask them to remove the label if you think it doesn't apply. Thank you for submitting this issue and helping make Garden a better product!

stale[bot] avatar Jan 03 '22 20:01 stale[bot]

This issue has been automatically marked as stale because it hasn't had any activity in 90 days. It will be closed in 14 days if no further activity occurs (e.g. changing labels, comments, commits, etc.). Please feel free to tag a maintainer and ask them to remove the label if you think it doesn't apply. Thank you for submitting this issue and helping make Garden a better product!

stale[bot] avatar Jul 31 '22 01:07 stale[bot]

This issue has been automatically marked as stale because it hasn't had any activity in 90 days. It will be closed in 14 days if no further activity occurs (e.g. changing labels, comments, commits, etc.). Please feel free to tag a maintainer and ask them to remove the label if you think it doesn't apply. Thank you for submitting this issue and helping make Garden a better product!

stale[bot] avatar Jan 07 '23 20:01 stale[bot]

This remains an issue. Here's a screenshot of my very first time using garden: Screen Shot 2023-01-17 at 10 36 49 AM

Pretty bad for a first-time user experience!

I would like to be able to set NO_COLOR=1 and get garden to use monochromatic output. See https://no-color.org/. The --no-color output or any of the other suggestions are fine too.

spenczar avatar Jan 17 '23 18:01 spenczar

This issue has been automatically marked as stale because it hasn't had any activity in 90 days. It will be closed in 14 days if no further activity occurs (e.g. changing labels, comments, commits, etc.). Please feel free to tag a maintainer and ask them to remove the label if you think it doesn't apply. Thank you for submitting this issue and helping make Garden a better product!

stale[bot] avatar May 21 '23 21:05 stale[bot]

I'm terribly sorry for the way overdue reply.

~Garden does indeed support the NO_COLOR environment variable (or rather the underlying library we use for rendering colors).~

~Is that not working for you?~

My apologies, I misread this. We support FORCE_COLOR not NO_COLOR but we absolutely should. But for now FORCE_COLOR=0 would be the same as NO_COLOR=true

eysi09 avatar Nov 20 '23 14:11 eysi09