Add support for querying the DECSCUSR setting #17659
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
This PR adds support for querying the cursor style - technically the
state of the
DECSCUSR
setting - using aDECRQSS
escape sequence.References and Relevant Issues
The initial
DECRQSS
support was added in PR #11152, but it wasn'tpractical to report the cursor style until conpty passthrough was added
in PR #17510.
Detailed Description of the Pull Request / Additional comments
If the user has chosen a cursor style that isn't one of the shapes
supported by the
DECSCUSR
control, we report those as 0 (i.e. thedefault style). That way, if an application later tries to restore the
cursor using the returned value, it should still be reset to its
original state.
I also took the opportunity in this PR to do some refactoring of the
other
DECRQSS
reports, since several of them were using unnecessaryappending that could be simplified to a single
fmt::format
call, oreven just static strings in some cases.
Validation Steps Performed
I've checked the reports are working as expected in Vttest, and also
added some unit tests.
PR Checklist