Repository navigation
Only disable color when NO_COLOR is non-empty - #1976
Open
waldekmastykarz wants to merge 1 commit into
Open
waldekmastykarz wants to merge 1 commit into
waldekmastykarz wants to merge 1 commit into
Conversation
Per https://no-color.org, NO_COLOR applies only when present and not empty. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 09b222bb-b264-4461-926d-32f935613554
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix meets the requirement, preserves existing overrides, and includes appropriate regression tests.
No open issues 🎉
What changed in this PR
Fixes #1967 by keeping color enabled when NO_COLOR is empty, matching the documented standard.
Changes:
- Extracts color-disable logic into a testable helper.
- Preserves
--no-colorandTERM=dumbbehavior. - Adds regression tests for environment variables and the command-line override.
| File | Description |
|---|---|
| DevProxy/Commands/DevProxyCommand.cs | Requires a non-empty NO_COLOR to disable color. |
| DevProxy.Tests/DevProxyCommandNoColorTests.cs | Tests environment values and existing overrides. |
Review effort: Balanced
This branch has not been deployed
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.
Closes #1967
Per no-color.org,
NO_COLORshould disable color only when present and not empty. Previously anyNO_COLORvalue, including empty, disabled color.ShouldDisableColorhelper usingstring.IsNullOrEmpty.NO_COLOR(unset/empty/non-empty),--no-color, andTERM=dumb.