fusesource / jansi

Jansi is a small java library that allows you to use ANSI escape sequences to format your console output which works even on windows.
http://fusesource.github.io/jansi/
Apache License 2.0
1.11k stars 140 forks source link

Look for environment variables `NO_COLOR` and `FORCE_COLOR` #279

Open ewels opened 9 months ago

ewels commented 9 months ago

It'd be great if this library could natively respect NO_COLOR if set in the environment variables.

See https://no-color.org/

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.

There's also FORCE_COLOR - https://force-color.org/

Command-line software which outputs colored text should check for a FORCE_COLOR environment variable. When this variable is present and not an empty string (regardless of its value), it should force the addition of ANSI color.

If both are set, NO_COLOR should win..