-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add gnu_legacy
feature
#66
Conversation
@sharkdp I updated my coreutils branch with this version and it indeed fixed the gnu tests. uutils/coreutils#4867 (comment) |
I think it's a little strange to hardcode two-digit CSI codes. I don't think GNU ls does that, it just prints what's in |
Thanks for the heads up, you are correct in a sense that From what I understand LSCOLORS crate is using terminal libraries to paint the parsed numbers back into terminal native color codes. Therefore in my opinion this works as intended, two-digit code in, two digit code out. There is no direct parse, but two individual sides with different goals. The |
@sharkdp I did another round of tests against my implementation and while it will fix two gnu drop in tests, something seems off when I do more extensive testing. I will have another look on behaviour. Sorry letting you wait so much. |
Here's an interesting GNU behaviour: tavianator@graphene $ LS_COLORS= ls --color /usr/bin/ls | xxd
00000000: 1b5b 306d 1b5b 3031 3b33 326d 2f75 7372 .[0m.[01;32m/usr
00000010: 2f62 696e 2f6c 731b 5b30 6d0a /bin/ls.[0m.
tavianator@graphene $ LS_COLORS="no=01;37" ls --color /usr/bin/ls | xxd
00000000: 1b5b 306d 1b5b 3031 3b33 376d 1b5b 6d1b .[0m.[01;37m.[m.
00000010: 5b30 313b 3332 6d2f 7573 722f 6269 6e2f [01;32m/usr/bin/
00000020: 6c73 1b5b 306d 0a ls.[0m. |
Hi @tavianator , can you please elaborate on what you find interesting and how it relates to this PR? |
If |
@sharkdp I revisited the strange behaviour as mentioned above. I added a new function called Changes
To-Do
GNU testsPlease see uutils/coreutils#4867 for the current status. |
Ah I think I might know why: if $ printf '\033[3mITALICS\n'; ls file dir
ITALICS
file dir
Instead of |
@tavianator yes exactly. Seems like I can simply use |
There is absolutely no hurry, certainly not from my side. Thank you very much for working on this. I will wait until this is in a merge-able state before I review it. |
This release fixes the problem that blocked sharkdp#68 This PR just keeps the behavior as before and does not yet incorporate the GNU compatibility focussed changes as worked on in sharkdp#66
@alexkunde do you have an eta for completed this? thanks |
@sharkdp it looks good to me (besides the conflict), maybe this could be reviewed now ? thanks |
I'm happy to include this but it would be great if someone could put in the work to resolve the conflicts and maybe also to review this. |
i rebased it here: |
Hi,
this crate is used in the rust drop-in replacement for gnu coreutils called uucoreutils.
The original GNU util
ls
is still using some extended modes that are yet not supported by this crate.To continue using this crate, it would really help to improve on those two topics. This PR will add both functionalities.
nu-ansi-term still needs to officially release the feature, so this is a draft for now.
After the merge, this GNU test will turn green:
OLD
After both PRs
Thanks for your help!