Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Console] Add Ansi8 (256 color) support, improve true color (Ansi24) support detection#46944
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
julien-boudry commentedJul 14, 2022
| Q | A |
|---|---|
| Branch? | 6.2 for features |
| Bug fix? | no |
| New feature? | yes |
| Deprecations? | no |
| License | MIT |
- Refactor the detection code of the colorimetric capacities of the terminal (much easier to extend next)
- Improve true color terminal detection according tohttps://github.com/termstandard/colors/
- Add detection for 256 colors terminal (Ansi8 support) and add the conversion from true color (Ansi24) to it. This is especially useful for the Apple Terminal which is still deployed by default in 2022, but not only.
carsonbot commentedJul 15, 2022
Hey! I think@CupOfTea696 has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
julien-boudry commentedJul 15, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
In pratice:
|
4d7092c toe0ea32eCompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
7f8f760 toaaa3f37CompareNote:@fabpot fabbot.io doesn't like Enum with methods. And not also empty line before doc. comments on |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
I will change the enum name soon as discussed. Add one more test. And Squash all these commits at the end. And possibly, we will be perfect. |
922741b tocfaffa0Compare…improves terminal support detection (Ansi4, Ansi8, Ansi24)* The detection of terminal capabilities is always conservatively estimated, without speculation that may result in display errors. But significantly improved, bringing in particular 256 colors compatibility with Apple Terminal (instead of 8).* Ansi8 is used by converting the RGB hexadecimal to the nearest color.* The whole corresponding code is refactored and many tests are added for both existing and new features.
…improves terminal support detection (Ansi4, Ansi8, Ansi24)* The detection of terminal capabilities is always conservatively estimated, without speculation that may result in display errors. But significantly improved, bringing in particular 256 colors compatibility with Apple Terminal (instead of 8).* Ansi8 is used by converting the RGB hexadecimal to the nearest color.* The whole corresponding code is refactored and many tests are added for both existing and new features.
Thank you@julien-boudry. |
…lor Mode (julien-boudry)This PR was merged into the 6.2 branch.Discussion----------[Console] Terminal Color Mode refactoring and force Color Mode| Q | A| ------------- | ---| Branch? | 6.2 for features| Bug fix? | no| New feature? | yes| Deprecations? | no| License | MITContinue#46944Terminal Color Mode refactoring: Adding a way to force color mode by the dev. user (with a new method), fewer `getenv()` calls (cache value), simpler tests (use the a new method and a new constant).For example, it can be useful in an environment where none of the expected environment variables are available (Docker container...) , but where the support of a specific mode is imperative.A future evolution could be to add an optional default option to all commands to force a particular mode by the final user.Commits-------4cb8384 [Console] Terminal Color Mode refactoring: Adding a way to force color mode by user, fewer getenv() calls, simpler tests.