Repository navigation
fix: respect disabled colors when dimming bars - #651
Open
spicysharkco wants to merge 1 commit into
Open
spicysharkco wants to merge 1 commit into
spicysharkco wants to merge 1 commit into
Conversation
With --dim, or dim = true in the config file, the percent bar was painted dark grey even when colors were off: with -c, with NO_COLOR set, or when stdout is not a terminal. Piped output then had ESC[90m and ESC[0m around the bar, while sizes and names stayed plain. Check colors_on before dimming the bar, as the size and name painters already do. With -C the bar is still dimmed.
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.
With
--dim, ordim = truein the config file, the percent bar is painted dark grey even when colors are off. Colors are off with-c, withNO_COLORset, or when stdout is not a terminal. Piping the output to a file or tolessthen showsESC[90mandESC[0maround the bar, while sizes and names stay plain:The first command should print 0, like the second. The
-chelp says "No colors will be printed".The dim branch checks only
dim. The size and name painters checkcolors_onbefore painting. The fix makes the bar check it too. With-C, the bar is still dimmed.test_dim_bars_respect_color_settinginsrc/display.rscovers the fourdim/colors_onpairs.cargo test --locked test_dim_bars_respect_color_settingfailed 3 of 3 runs before the fix and passed 3 of 3 after it.