Skip to content

Conversation

@Techcable
Copy link
Member

See https://no-color.org/

Support for CLICOLOR and CLICOLOR_FORCE is a bigger change,
and will have to wait till v2.10.
See https://bixense.com/clicolors/ for more details.

See <https://no-color.org/>

Support for CLICOLOR and CLICOLOR_FORCE is a bigger change,
and will have to wait till v2.10.
See <https://bixense.com/clicolors/> for more details.
@Techcable Techcable force-pushed the fix/respsect-no-color branch from 96650be to a6f335d Compare August 21, 2025 01:46
@Techcable Techcable merged commit a6f335d into slog-rs:master Aug 21, 2025
20 checks passed
impl AnyTerminal {
fn should_use_color(&self) -> bool {
// Respect NO_COLOR <https://no-color.org/>
if std::env::var_os("NO_COLOR").map_or(false, |x| !x.is_empty()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suspcion: Might be slow, might want to wrap it in OnceLock or something like it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only called from TermDecoratorBuilder and we already do a isatty call on stdout/stderr.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants