Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Option to disable color #428

Closed
hellishvictor opened this issue May 14, 2024 · 3 comments · Fixed by #458
Closed

Feature request: Option to disable color #428

hellishvictor opened this issue May 14, 2024 · 3 comments · Fixed by #458

Comments

@hellishvictor
Copy link

Hi, here I'm testing the cli, and since I'm on Win 7, it shows like this;

 Numbat is a statically typed programming language for scientific computations
 with first class support for physical dimensions and units. Please refer to
 the full documentation online at ←[32mhttps://numbat.dev/doc/←[0m or try one of these
 examples:

 >>> 8 km / (1 h + 25 min)
     ←[1m=←[0m ←[33m5.64706←[0m ←[36mkm/h←[0m←[2m    [←[0m←[3;34mVelocity←[0m←[2m]←[0m

 >>> atan2(30 cm, 1 m) -> deg
     ←[1m=←[0m ←[33m16.6992←[0m←[36m°←[0m

 >>> let ω = 2 π c / 660 nm

 >>> print("Energy of red photons: {ℏ ω -> eV}")

It gets very confusing with all the "←[1m=←[0m", so, an option to disable the color and display every in monochrome would be welcome.
Cheers.

@eminence
Copy link
Contributor

Please try running with the NO_COLOR=1 environment variable

@hellishvictor
Copy link
Author

That did the trick, but please consider add the argument, (I use batch scripts with colorshow from Aacini) these cli already have it implemented:

https://github.com/MiSawa/xq
--monochrome-output,-M Force monochrome output

https://github.com/wader/fq
--monochrome-output,-M Force monochrome output

https://github.com/01mf02/jaq
--color never

Cheers.

@sharkdp
Copy link
Owner

sharkdp commented May 14, 2024

Thank you for the feedback. I'd be glad to accept a PR to add a --color=never/always/auto option, like most of my other CLI tools have as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants