-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ls: Match the gnu behavior for colors #5603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
it is failing but I would like to get the results |
GNU testsuite comparison:
|
1 similar comment
GNU testsuite comparison:
|
GNU testsuite comparison:
|
src/uu/ls/Cargo.toml
Outdated
@@ -22,7 +22,7 @@ number_prefix = { workspace = true } | |||
uutils_term_grid = { workspace = true } | |||
terminal_size = { workspace = true } | |||
glob = { workspace = true } | |||
lscolors = { workspace = true } | |||
lscolors = { workspace = true, features = ["gnu_legacy"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? We didn't have the nu-ansi-term
feature mentioned here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether this is the intended behavior or a bug. When running ls --color=always
and redirecting the output to a file, the output of uutils ls
and GNU ls
differs. All but the first escape code are different, with the ones from uutils ls
being prefixed with ^[[0m
.
how do you compare the output ?
|
Yes, that's what I'm using. |
Here the steps I did:
|
The difference is that GNU ls does not immediately reset the text style after each directory name. It only resets (^[[0m) before starting a new colored text, or at the end of the output. |
GNU testsuite comparison:
|
GNU testsuite comparison:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! The spell-check is failing but once that's fixed LGTM!
GNU testsuite comparison:
|
No description provided.