Repository navigation
Conversation
The entries in the TERMS list are glob patterns, but ls only honored an exact name or a trailing *. Patterns such as *color* and con[0-9]*x[0-9]* never matched, so TERM=konsole-256color got no color. Fixes uutils#9098
…m-glob # Conflicts: # tests/by-util/test_ls.rs
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 #9098
TERM=konsole-256color ls --color=alwaysprinted no color.is_color_compatible_termmatched the entries ofuucore::colors::TERMSeither exactly or as a prefix when they end in*, but a few entries are real glob patterns:*color*,*direct*andcon[0-9]*x[0-9]*were read as literal prefixes and never matched anything. The closure now matches every entry withparse_glob::from_str, the same waylsalready handles--ignoreand--hide, anddircolorsmatches this list.linux-256colorandvte-256colorwere affected the same way and now get color.dumbis in none of the patterns, so it still gets none.I added
test_term_glob_patternstotests/by-util/test_ls.rs. It checkskonsole-256color,linux-256color,konsole-directandcon80x25get color, thatxterm-256colorandkonsolestill do, and thatdumbdoes not. It fails without the fix onTERM=konsole-256colorandtest_lspasses with it (186 passed, 1 ignored).cargo fmtandclippy -p uu_ls --all-targets -D warningsare clean. Tested on macOS only.