-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversion of Segments to Windows Console API calls on legacy Windows platform #1993
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1993 +/- ##
==========================================
- Coverage 99.81% 99.54% -0.27%
==========================================
Files 71 73 +2
Lines 7058 7294 +236
==========================================
+ Hits 7045 7261 +216
- Misses 13 33 +20
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@darrenburns I have a question. |
@UltraStudioLTD The wrapper abstracts legacy Windows console API calls behind an easier to understand and more Pythonic interface, so that the rest of Rich doesn't need to know anything about legacy Windows APIs. The purpose of this PR is to drop the dependency on Colorama, and handle older Windows systems in a slightly more performative way. |
d5e2835
to
1a11ea3
Compare
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.
Great! Just a few requests.
@darrenburns Just looking in to styles a bit more. According to the colorama docs, it will interpret bold as bright, and also dim as normal intensity. We should probably do the same. Colorama doesn't support the "reverse" style, but I think we could do that quite easily by swapping "fore" and "back". Would you mind making those changes? |
@willmcgugan Made those changes in #2019 |
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.
LGTM
…ixes Add support for bold, dim, and reverse on legacy Windows consoles
Type of changes
Checklist
Description
Currently we depend on Colorama, which converts ANSI to Windows Console API calls in the context of legacy Windows terminals. This change removes the Colorama dependency, and has Rich directly call the Windows Console API.
Closes #1991
Comparing new vs old
rich.syntax
- New on left, old (Colorama) on rightrich.color
- left column is this branch, right column is masterrich.palette
- left this branch, right masterrich.progress
- left this branch, right master - no difference in the amount of flickering, however, on master the cursor occasionally flashes on screen.