Fix typo and NO_COLOR environment variable handling#30
Open
assisted-by-ai wants to merge 1 commit intoKicksecure:masterfrom
Open
Fix typo and NO_COLOR environment variable handling#30assisted-by-ai wants to merge 1 commit intoKicksecure:masterfrom
assisted-by-ai wants to merge 1 commit intoKicksecure:masterfrom
Conversation
- NO_COLOR check now disables color when the variable is present regardless of value, per the no-color.org spec. Previously only NO_COLOR=1 was honored. - Fix transposed "ji" → "ij" in test_clean_ascii alphabet string. - Update test_pty_color to expect no-color output when NO_COLOR=0, matching the corrected behavior. https://claude.ai/code/session_014Qvwfhuw1DH4BJNdzrM6x1
ArrayBolt3
reviewed
Apr 8, 2026
Contributor
ArrayBolt3
left a comment
There was a problem hiding this comment.
Mostly redundant, but I accepted the typo fix in ArrayBolt3@d0e253b.
| test_string: str = ( | ||
| " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]" | ||
| + "^_`abcdefghjiklmnopqrstuvwxyz{|}~\n" | ||
| + "^_`abcdefghijklmnopqrstuvwxyz{|}~\n" |
| main_func=unicode_show_main, | ||
| argv0=self.argv0, | ||
| stdout_string=expect_string_color, | ||
| stdout_string=expect_string_nocolor, |
Contributor
There was a problem hiding this comment.
This test was removed in an earlier commit.
| USE_COLOR = ( | ||
| not os.getenv("NOCOLOR") | ||
| and os.getenv("NO_COLOR") != "1" | ||
| and os.getenv("NO_COLOR") is None |
Contributor
There was a problem hiding this comment.
This was fixed in a different PR (and this is the wrong way to fix it).
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.
This PR fixes two issues in the unicode_show codebase:
Summary of Changes:
Key Changes:
test_clean_ascii(): Changed "abcdefghjiklmnopqrstuvwxyz" to "abcdefghijklmnopqrstuvwxyz" to include the missing 'i'main(): Changed fromos.getenv("NO_COLOR") != "1"toos.getenv("NO_COLOR") is Noneto properly follow the NO_COLOR specification, which disables color output when the variable is set to any value (not just "1")test_pty_color(): Changedstdout_string=expect_string_colortostdout_string=expect_string_nocolorto match the correct expected behaviorImplementation Details:
The NO_COLOR specification states that color output should be disabled whenever the NO_COLOR environment variable is present, regardless of its value. The previous implementation only checked if it was set to "1", which was incorrect. The fix uses
is Noneto check if the variable is unset, which is the proper way to detect the absence of an environment variable in Python.https://claude.ai/code/session_014Qvwfhuw1DH4BJNdzrM6x1