Skip to content
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 feature: gnu_legacy mode for ansi styles #39

Merged
merged 3 commits into from
May 23, 2023

Conversation

alexkunde
Copy link

Hi,
gnu coreutils are still using double digit styles instead of single digit styles.
To make this available in uucoreutils (the rust drop in replacement for gnu core utils) I added a feature called gnu_legacy.
Related PR

By turning it on it will generate styles double digit. If not turned on it will behave as before. Tests have been added.

// without feature flag gnu_legacy
    test!(bunderline:            Style::new().bold().underline();   "hi" => ,"\x1B[1;4mhi\x1B[0m");
// with feature flag gnu_legacy
    test!(bunderline:            Style::new().bold().underline();   "hi" => "\x1B[01;04mhi\x1B[0m");

Please see the code and I hope this feature can make it.

The second missing feature would be to have the option to reset a style before applying. I would open another PR for this.

@fdncred
Copy link

fdncred commented May 22, 2023

looks like some tests are failing

@alexkunde
Copy link
Author

Hi, locally it correctly tests now. I had to add some wrapper around the docs. Now the feature tests are documented on functions as well. All lines starting with # are evaluated but not shown as a tooltip.

@fdncred fdncred merged commit 564d7ba into nushell:main May 23, 2023
@fdncred
Copy link

fdncred commented May 23, 2023

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants