-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Replace nu-ansi-term
with anstyle
crates
#2567
Conversation
So, I looked into the failing regression tests and the difference is that |
Thank you and sorry for the review delay. Can you please go into more details why this is necessary/beneficial? |
I think the benefit is that we get rid of a dependency ( |
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.
This looks good to me. The ANSI color diffs all seem to be only differences in how the colors are encoded, not how they are displayed (at least in my terminal I did not see any actual color change).
Maybe there is a mistake among all those lines. That can be fixed with a follow up PR if needed. When I glance it over the code changes slowly it all looks reasonable to me.
Can you rebase this on latest master please?
This could have adverse effects though, right? We need to write more output. And terminal emulators might take a longer time to parse the input and/or to set up the proper style. I would appreciate if we could run a benchmark to see that this doesn't have any negative effects. Since we want to include possible effects of the terminal emulator, we can use |
Good point about performance. I didn't think about that. Let's see some numbers before we merge. |
The crate is already pulled in by `clap`.
The `anstyle` crate is already used by `clap` to print ANSI text styles.
The `anstyle` crate emits the escape codes for the bold, italic, etc. separately. Now, it is `\x1B[3m\x1B[38;2;102;217;239m` for `RGB(102, 217, 239)` and italic instead of `\x1B[3;38;2;102;217;239m`.
Closing for now to keep the PR inbox clean. Of course feel free to re-open if you resume work on this! |
The
nu-ansi-term
crate can now be replaced by theanstyle
crates which are used byclap
for its ANSI text styling.