-
Notifications
You must be signed in to change notification settings - Fork 107
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
Improve the formatting of disabled menu items in different terminals #236
Conversation
Disabled items are now modified to use the ANSI "bright" equivalent of the same colour as their foreground text, as well as the dim escape sequence modifier.
hi @jackwh thanks for the PR! Could you maybe add a screenshot so we can see how it looks? Also looks like you need to update a test + some return types |
Codecov Report
@@ Coverage Diff @@
## master #236 +/- ##
============================================
+ Coverage 92.87% 92.91% +0.04%
- Complexity 623 629 +6
============================================
Files 37 37
Lines 1866 1877 +11
============================================
+ Hits 1733 1744 +11
Misses 133 133
Continue to review full report at Codecov.
|
@AydinHassan Thanks, I've fixed the return types and the broken test. Here's some screenshots — the first one is before any changes were made, and you can see there's no dim formatting on the PhpStorm window (on the right — macOS on the left). The rest are after the changes. It's not perfect, but without a terminal supporting dimming, it's better than what was there before I think. Of course, ultimately its effectiveness will depend on the ANSI colours defined in the user's Terminal colourscheme. Before: After: |
Thank you @jackwh looks great to me and thanks for the accompanying screenshots, that makes it super easy for me to check and approve! I'm happy to merge after the last question regarding the test has been resolved :) |
Thanks, happy to contribute! It's a great package, thank you for releasing it! |
@jackwh merged and thanks for contributing! |
I spent ages wondering why my disabled menu item didn't look like it was disabled, and eventually I figured out it's just that some Terminals don't support some of the less common ANSI escape sequences.
In my case, I was using PhpStorm's built-in Terminal window — which is obviously going to be a pretty common choice for users of this package — so here's a PR for a workaround.
60
to an existing colour codeWhilst I was researching what was going wrong, I found this list comparing support for the blink effect across different popular terminals. Though it's obviously for a different effect it does go to show you can't expect every terminal to support dimming.