woodruffw / shaq

A CLI client for Shazam
MIT License
105 stars 6 forks source link

Feature request: NO_COLOR standard implementation #24

Closed hellishvictor closed 4 months ago

hellishvictor commented 4 months ago

Hi, it would be great implement the NO_COLOR standard on shaq since there's many CLI already with it (jaq, miller, crop, upx, xq, etc..,) and save the users from use "color=never", "--monochrome-color" or whatever.

Command-line software which adds ANSI color to its output by default should check
 for a NO_COLOR environment variable that, when present and not an empty string
 (regardless of its value), prevents the addition of ANSI color.

By adopting this standard, users that prefer to have plain, non-colored text output
 can export NO_COLOR=1 to their shell’s environment and automatically disable color
 by default in all supported software.

If your software outputs color by default, please consider not doing so. 

More info on: https://no-color.org/

Cheers

woodruffw commented 4 months ago

Thanks for the report. shaq uses rich for rendering under the hood, which does already support NO_COLOR: https://rich.readthedocs.io/en/stable/console.html#environment-variables

Did you give that a try?

hellishvictor commented 4 months ago

Thanks for the report. shaq uses rich for rendering under the hood, which does already support NO_COLOR: https://rich.readthedocs.io/en/stable/console.html#environment-variables

Did you give that a try?

Here (using Win 7 x64 SP1) the output on cmd shows:

shaq is listening... ---------------------------------------- 100% 0:00:09
[?25hTrack: Allegro Con Brio
Artist: Beethoven
woodruffw commented 4 months ago

Can you confirm that you set NO_COLOR=1 in your environment?

(In the future: it's very helpful if you share the exact command you ran, including the environment settings you have.)

Also note: NO_COLOR doesn't mean "no ANSI escape sequences", per the warning in that doc I linked. If you need absolutely no ANSI escapes, you should set TERM=dumb.

hellishvictor commented 4 months ago

You're hilarious xD Thanks for nothing.

woodruffw commented 4 months ago

I'm sorry, but this is the second issue you've filed in ~24 hours where there was (1) virtually no detail, and (2) the answer was either "file it upstream" or "please confirm that this isn't already supported." If you can't do that kind of basic pre-triage or respond to questions that help me perform that triage, then I'm not willing to have you submit issues to my projects.