-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
XTPUSHSGR doesn't handle default and zero parameters correctly #11883
Comments
@j4james is there anything xterm specific in those test strings? On my Fedora workstation the xterm shows as above however gnome-terminal doesn't: xterm test: |
VTE doesn't support For reference, see https://gitlab.gnome.org/GNOME/vte/-/issues/23 |
…1888) ## Summary of the Pull Request This replaces the `std::bitset` for the `SgrSaveRestoreStackOptions` enum with a `til::enumset` type, thus avoiding the need to cast the `enum` to a `size_t` every time a value is set or tested. This also fixes an issue with the handling of omitted and zero parameters in the `XTPUSHSGR` sequence, which are meant to be ignored, and not interpreted as "all". ## PR Checklist * [x] Closes #11879 * [x] Closes #11883 * [x] CLA signed. * [ ] Tests added/passed * [ ] Documentation updated. * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Detailed Description of the Pull Request / Additional comments In addition to dropping all the `static_cast` operations, the use of the `til::enumset` also allowed us to get rid of the `try`/`catch` handling that was previously required in a couple of places, since the `til::enumset` operations don't throw. And to fix the zero parameter handling, we just needed to add an additional lower bound when validating that options are in range - if an option is 0 (`All`), it will now just be ignored. ## Validation Steps Performed The updated code still passes the existing unit tests, and I've manually confirmed that it fixes the test case for omitted and zero parameters from issue #11883.
/cc @jazzdelightsme for errata about XTPUSH/POP in Terminal 😄 |
Unfortunately, this is broken in conhost in Windows 11 as well -- and is not likely to be fixed until the next release milestone |
I don't think that's a big deal though. These are really edge cases. I just happened to notice them when I was testing my enumset changes. |
Belated thank you for noticing and fixing this! |
🎉This issue was addressed in #11888, which has now been successfully released as Handy links: |
Windows Terminal version
1.12.2931.0
Windows build number
10.0.19041.1348
Other Software
No response
Steps to reproduce
Expected Behavior
The first line should be both reversed and underlined.
The second line should be underlined only.
The last line should be neither reversed nor underlined.
This is a screenshot from XTerm:
Actual Behavior
All three lines are displayed as reversed and underlined.
The problem is that we're interpreting zero parameters and default parameters to mean that all attributes should be saved. However, the documentation states that we should only be saving all attributes when no parameters have been specified at all.
The text was updated successfully, but these errors were encountered: