Repository navigation
Conversation
Read NO_COLOR as an OS string and ignore empty values. Nonempty values, including non-Unicode values on Unix, disable automatic color. Let explicit always/never color configuration override the environment while keeping auto responsive to NO_COLOR. Command-line resolution remains first, and the generic ordering for other flags is unchanged. Add unit and CLI coverage for environment values, built-in defaults, and overrides, and document the behavior in the README, man page, and config samples. Full test binaries pass with Rust 1.85 and 1.98 under default/no-default features, with NO_COLOR both unset and set. Refs: lsd-rs#1060
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #1060 and the configuration/default interaction discussed in #544.
NO_COLORis already supported, but the environment check treats an empty value as active and ignores non-Unicode values on Unix. Explicitcolor.when: alwaysalso loses to the environment, contrary to the configuration override guidance.This change:
NO_COLORas an OS string and only treats nonempty values as active.always/nevercolor configuration override the environment.auto, including the built-in default, still honorsNO_COLOR, so the default configuration does not accidentally turn the variable off.Validation on Linux:
NO_COLORboth unset and set. Each default run has 443 tests; each no-default run has 439. Runs use non-root private namespaces, including the permission-sensitive tests.cargo clippy --locked --tests -- -D warningsand theclap/deprecatedcheck. Rust 1.98.0's stricter Clippy reports the same 10 existing diagnostics on the clean base and this patch, all in unchanged files; its formatting andclap/deprecatedcheck pass.TODO
cargo fmtdoc/samplesdoc/lsd.md