[PR #14998] [MERGED] Add support for the Presentation State reports #30340

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14998
Author: @j4james
Created: 3/16/2023
Status: Merged
Merged: 3/23/2023
Merged by: @DHowett

Base: mainHead: feature-decrqpsr


📝 Commits (10+)

  • 0eaea7f Hook up the DECRQPSR and DECRSPS sequences.
  • 590acf6 Add support for the DECTABSR report.
  • 40e6db7 Allow TerminalOutput state to be queried.
  • 189c23a Add support for the DECCIR report.
  • 5f65785 Add some unit tests.
  • 25b670b Add expected words to spelling dictionary.
  • 89bbb0f Fix formatting.
  • 2effde0 Fix signed/unsigned mismatches.
  • 0cd9244 PR feedback.
  • f3658f4 More efficient VTID to string conversion.

📊 Changes

13 files changed (+661 additions, -24 deletions)

View changed files

📝 .github/actions/spelling/expect/expect.txt (+7 -0)
📝 src/terminal/adapter/DispatchTypes.hpp (+27 -9)
📝 src/terminal/adapter/ITermDispatch.hpp (+3 -0)
📝 src/terminal/adapter/adaptDispatch.cpp (+348 -1)
📝 src/terminal/adapter/adaptDispatch.hpp (+9 -1)
📝 src/terminal/adapter/termDispatch.hpp (+3 -0)
📝 src/terminal/adapter/terminalOutput.cpp (+41 -10)
📝 src/terminal/adapter/terminalOutput.hpp (+8 -2)
📝 src/terminal/adapter/ut_adapter/adapterTest.cpp (+203 -0)
📝 src/terminal/parser/OutputStateMachineEngine.cpp (+7 -0)
📝 src/terminal/parser/OutputStateMachineEngine.hpp (+3 -1)
📝 src/terminal/parser/telemetry.cpp (+1 -0)
📝 src/terminal/parser/telemetry.hpp (+1 -0)

📄 Description

This PR introduces two new sequences, DECRQPSR and DECRSPS, which
provide a way for applications to query and restore the presentation
state reports. This includes the tab stop report (DECTABSR) and the
cursor information report (DECCIR).

One part of the cursor information report contains the character set
designations and mapped G-sets. But we weren't tracking that data in a
way that could easily be reported, so I needed to do some refactoring in
the TerminalOutput class to make that accessible.

Other than that, the rest was fairly straightforward. It was just a
matter of packaging up all the information into the correct format for
the returned DCS string, and in the case of the restore operations,
parsing the incoming data and applying the new state.

Validation Steps Performed

Thanks to @al20878, we were able to test these operations on a real
VT525, and I've manually verified that our implementation matches that
behavior. I've also added some unit tests covering both reports.

Closes #14984


🔄 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/14998 **Author:** [@j4james](https://github.com/j4james) **Created:** 3/16/2023 **Status:** ✅ Merged **Merged:** 3/23/2023 **Merged by:** [@DHowett](https://github.com/DHowett) **Base:** `main` ← **Head:** `feature-decrqpsr` --- ### 📝 Commits (10+) - [`0eaea7f`](https://github.com/microsoft/terminal/commit/0eaea7f3f71cc848c5944a4af6351b419f47bfd3) Hook up the DECRQPSR and DECRSPS sequences. - [`590acf6`](https://github.com/microsoft/terminal/commit/590acf6d7c22097341ce33b5a3297821f7016181) Add support for the DECTABSR report. - [`40e6db7`](https://github.com/microsoft/terminal/commit/40e6db7af21c3f2065b121e12c250d88470e6489) Allow TerminalOutput state to be queried. - [`189c23a`](https://github.com/microsoft/terminal/commit/189c23a36bc30a4e043b674eedf435a27dfb2f17) Add support for the DECCIR report. - [`5f65785`](https://github.com/microsoft/terminal/commit/5f65785276b8ca3e360d0d3bb997f2b38b37361b) Add some unit tests. - [`25b670b`](https://github.com/microsoft/terminal/commit/25b670b53547142c1681cea25bd06f4d98ce295f) Add expected words to spelling dictionary. - [`89bbb0f`](https://github.com/microsoft/terminal/commit/89bbb0f4225f15ded35d5864dacfdced48e6164e) Fix formatting. - [`2effde0`](https://github.com/microsoft/terminal/commit/2effde096501422e51dc3b56b07f0bd09b59f9d2) Fix signed/unsigned mismatches. - [`0cd9244`](https://github.com/microsoft/terminal/commit/0cd9244bc9eec995f5317290f54fbd3fa81f9e82) PR feedback. - [`f3658f4`](https://github.com/microsoft/terminal/commit/f3658f43efb0265b2ae06141630aa7e4e624ca48) More efficient VTID to string conversion. ### 📊 Changes **13 files changed** (+661 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/expect/expect.txt` (+7 -0) 📝 `src/terminal/adapter/DispatchTypes.hpp` (+27 -9) 📝 `src/terminal/adapter/ITermDispatch.hpp` (+3 -0) 📝 `src/terminal/adapter/adaptDispatch.cpp` (+348 -1) 📝 `src/terminal/adapter/adaptDispatch.hpp` (+9 -1) 📝 `src/terminal/adapter/termDispatch.hpp` (+3 -0) 📝 `src/terminal/adapter/terminalOutput.cpp` (+41 -10) 📝 `src/terminal/adapter/terminalOutput.hpp` (+8 -2) 📝 `src/terminal/adapter/ut_adapter/adapterTest.cpp` (+203 -0) 📝 `src/terminal/parser/OutputStateMachineEngine.cpp` (+7 -0) 📝 `src/terminal/parser/OutputStateMachineEngine.hpp` (+3 -1) 📝 `src/terminal/parser/telemetry.cpp` (+1 -0) 📝 `src/terminal/parser/telemetry.hpp` (+1 -0) </details> ### 📄 Description This PR introduces two new sequences, `DECRQPSR` and `DECRSPS`, which provide a way for applications to query and restore the presentation state reports. This includes the tab stop report (`DECTABSR`) and the cursor information report (`DECCIR`). One part of the cursor information report contains the character set designations and mapped G-sets. But we weren't tracking that data in a way that could easily be reported, so I needed to do some refactoring in the `TerminalOutput` class to make that accessible. Other than that, the rest was fairly straightforward. It was just a matter of packaging up all the information into the correct format for the returned `DCS` string, and in the case of the restore operations, parsing the incoming data and applying the new state. ## Validation Steps Performed Thanks to @al20878, we were able to test these operations on a real VT525, and I've manually verified that our implementation matches that behavior. I've also added some unit tests covering both reports. Closes #14984 --- <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:40:12 +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#30340