cli
cli copied to clipboard
Support $NO_COLOR in CLI output
It would be nice to support the $NO_COLOR
environment variable, so that users with this preference (always) get plain text output. This is also helpful for piping output to other tools without having to get rid of the color escape codes.
Also see https://no-color.org/ and https://clig.dev/#output for more reasoning behind this. The issue has come up several times internally now.
It may be possible to change usage of colors with the libs we already use. Another option may be to look into https://github.com/muesli/termenv, which seems to make the CLI a lot smarter around using styles, but is probably a larger piece of work.
If we turned off color, would that include turning off emojis too or should that be its own flag NO_EMOJI
?
I would say to turn these off with$NO_COLOR
too, yes. They're in color, after all, so unless we can reliably convert them to ASCII .... 😅 And $NO_COLOR
seems to be a convention; $NO_EMOJI
would probably be somewhat of a surprise.
I thought the main use case for NO_COLOR
was preventing bash color escape sequences from getting spit out, in which case emoji are fine (just unicode chars) imo. But, maybe some people just hate all color too? :art:
A highlight of my day to see this ref to my side project https://clig.dev!
Good point, @alanchrt; I didn't think of it like that. There are people on the internet that want to disable emojis in terminal output, so supporting that sounds good to me.
I think we're using emoji in two ways: first one is adding a bit of character to the CLI and the second is more functional usage, like outputting OK/NOK statuses. A different approach may be necessary for them.
It's a great resource, @tashian! 😄
We also will print out fingerprints as emoji these days:
https://mobile.twitter.com/smallsteplabs/status/1489669356719988736