[PR #11152] Add basic support for the DECRQSS settings query #28442

Open
opened 2026-01-31 09:28:32 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/11152

State: closed
Merged: Yes


This PR adds support for the DECRQSS (Request Selection or Setting)
escape sequence, which is a standard VT query for reporting the state of
various control functions. This initial implementation only supports
queries for the DECSTBM margins, and the SGR graphic rendition
attributes.

This can be useful for certain forms of capability detection (#1040). As
one example in particular, it can serve as an alternative to the
COLORTERM environment variable for detecting truecolor support
(#11057).

Of the settings that can be queried by DECRQSS, the only other one
that we could be supporting at the moment is DECSCUSR (Cursor Style).
However, that would require passing the query through to the conpty
client, which is a lot more complicated, so I thought it best to leave
for a future PR.

For now this gets the basic framework in place, so we are at least
responding to queries, and even just supporting the SGR attributes
query is useful in itself.

Validation

I've added a unit test verifying the reports for the DECSTBM and SGR
settings with a range of different parameters. I've also tested the
DECSTBM and SGR reports manually in Vttest, under menu 11.2.5.3.6
(Status-String Reports).

**Original Pull Request:** https://github.com/microsoft/terminal/pull/11152 **State:** closed **Merged:** Yes --- This PR adds support for the `DECRQSS` (Request Selection or Setting) escape sequence, which is a standard VT query for reporting the state of various control functions. This initial implementation only supports queries for the `DECSTBM` margins, and the `SGR` graphic rendition attributes. This can be useful for certain forms of capability detection (#1040). As one example in particular, it can serve as an alternative to the `COLORTERM` environment variable for detecting truecolor support (#11057). Of the settings that can be queried by `DECRQSS`, the only other one that we could be supporting at the moment is `DECSCUSR` (Cursor Style). However, that would require passing the query through to the conpty client, which is a lot more complicated, so I thought it best to leave for a future PR. For now this gets the basic framework in place, so we are at least responding to queries, and even just supporting the `SGR` attributes query is useful in itself. Validation ---------- I've added a unit test verifying the reports for the `DECSTBM` and `SGR` settings with a range of different parameters. I've also tested the `DECSTBM` and `SGR` reports manually in _Vttest_, under menu 11.2.5.3.6 (Status-String Reports).
claunia added the pull-request label 2026-01-31 09:28:32 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28442