iroh icon indicating copy to clipboard operation
iroh copied to clipboard

Support informal `NO_COLOR` standard

Open b5 opened this issue 2 years ago • 3 comments

details are here: https://no-color.org/

basically, I think we should honor the NO_COLOR=1 env var convention and nix any ANSI color on the terminal when this value is set and nonempty. Once we've done so, we should submit a PR here to add ourselves to the list of projects that support

b5 avatar May 28 '23 01:05 b5

I am ready to tackle this.

Please ping me if the team wants to add --color auto/always/never/ and respect NO_COLOR env var.

azzamsa avatar Jun 22 '24 17:06 azzamsa

I am ready to tackle this.

Please ping me if the team wants to add --color auto/always/never/ and respect NO_COLOR env var.

@azzamsa sure, we'd accept a PR for this

flub avatar Jul 01 '24 14:07 flub

It turns out that Iroh-CLI uses the Colored under the hood, which supports NO_COLOR out of the box. You can check out its features here: https://github.com/colored-rs/colored?tab=readme-ov-file#features.

The current version of Iroh-CLI already respects the NO_COLOR environment variable, thanks to Colored.

  • When NO_COLOR is not set: image

  • When NO_COLOR is set: image

If my assumption is correct, then will open a PR here https://github.com/jcs/no_color

azzamsa avatar Jul 03 '24 11:07 azzamsa

Nice! I guess this can be closed then. Feel free to re-open if that's a mistake though.

flub avatar Jul 10 '24 09:07 flub