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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/11152
Author: @j4james
Created: 9/5/2021
Status: Merged
Merged: 9/9/2021
Merged by: @undefined

Base: mainHead: feature-decrqss


📝 Commits (5)

  • 812ef7e Add the basic framework for DECRQSS.
  • 5d8efdb Add a handler for the DECSTBM setting.
  • 1ecab6d Add a handler for the SGR setting.
  • 59e68e4 Add some unit tests.
  • d075652 Appease the spelling bot.

📊 Changes

8 files changed (+263 additions, -0 deletions)

View changed files

📝 .github/actions/spelling/expect/expect.txt (+1 -0)
📝 src/terminal/adapter/ITermDispatch.hpp (+2 -0)
📝 src/terminal/adapter/adaptDispatch.cpp (+146 -0)
📝 src/terminal/adapter/adaptDispatch.hpp (+5 -0)
📝 src/terminal/adapter/termDispatch.hpp (+2 -0)
📝 src/terminal/adapter/ut_adapter/adapterTest.cpp (+103 -0)
📝 src/terminal/parser/OutputStateMachineEngine.cpp (+3 -0)
📝 src/terminal/parser/OutputStateMachineEngine.hpp (+1 -0)

📄 Description

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).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/11152 **Author:** [@j4james](https://github.com/j4james) **Created:** 9/5/2021 **Status:** ✅ Merged **Merged:** 9/9/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `feature-decrqss` --- ### 📝 Commits (5) - [`812ef7e`](https://github.com/microsoft/terminal/commit/812ef7ec8c3ce5d1ef4ec2831cdb065c59c80347) Add the basic framework for DECRQSS. - [`5d8efdb`](https://github.com/microsoft/terminal/commit/5d8efdb1e7025e386457ec8c4cf33682191fdec4) Add a handler for the DECSTBM setting. - [`1ecab6d`](https://github.com/microsoft/terminal/commit/1ecab6d1f96ccc6d3fad968e817a39985da51d19) Add a handler for the SGR setting. - [`59e68e4`](https://github.com/microsoft/terminal/commit/59e68e4ae5b7c2bc440db395a870a8741f9fe758) Add some unit tests. - [`d075652`](https://github.com/microsoft/terminal/commit/d075652adace4160d6ef16d8fe075530bbd55d83) Appease the spelling bot. ### 📊 Changes **8 files changed** (+263 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/expect/expect.txt` (+1 -0) 📝 `src/terminal/adapter/ITermDispatch.hpp` (+2 -0) 📝 `src/terminal/adapter/adaptDispatch.cpp` (+146 -0) 📝 `src/terminal/adapter/adaptDispatch.hpp` (+5 -0) 📝 `src/terminal/adapter/termDispatch.hpp` (+2 -0) 📝 `src/terminal/adapter/ut_adapter/adapterTest.cpp` (+103 -0) 📝 `src/terminal/parser/OutputStateMachineEngine.cpp` (+3 -0) 📝 `src/terminal/parser/OutputStateMachineEngine.hpp` (+1 -0) </details> ### 📄 Description 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). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:28:31 +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#28437