[PR #13139] Add support for restoring a DECCTR color table report #29409

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

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

State: closed
Merged: Yes


This PR introduces the framework for the DECRSTS sequence which is
used to restore terminal state reports. But to start with, I've just
implemented the DECCTR color table report, which provides a way for
applications to alter the terminal's color scheme.

PR Checklist

  • Closes Invalid Title after opening new tab via command line (#13132)
  • 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

I've added the functions for parsing DEC RGB and HLS color formats into
the Utils class, where we've got all our other color parsing routines,
since this functionality will eventually be needed in other VT protocols
like Sixel and ReGIS.

Since DECRSTS is a DCS sequence, this only works in conhost for now,
or when using the experimental passthrough mode in Windows Terminal.

Validation Steps Performed

I've added a number of unit tests to check that the DECCTR report is
being interpreted as expected. This includes various edge cases (e.g.
omitted and out-of-range parameters), which I have confirmed to match
the color parsing on a real VT240 terminal.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/13139 **State:** closed **Merged:** Yes --- This PR introduces the framework for the `DECRSTS` sequence which is used to restore terminal state reports. But to start with, I've just implemented the `DECCTR` color table report, which provides a way for applications to alter the terminal's color scheme. ## PR Checklist * [x] Closes #13132 * [x] CLA signed. * [x] 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 I've added the functions for parsing DEC RGB and HLS color formats into the `Utils` class, where we've got all our other color parsing routines, since this functionality will eventually be needed in other VT protocols like Sixel and ReGIS. Since `DECRSTS` is a `DCS` sequence, this only works in conhost for now, or when using the experimental passthrough mode in Windows Terminal. ## Validation Steps Performed I've added a number of unit tests to check that the `DECCTR` report is being interpreted as expected. This includes various edge cases (e.g. omitted and out-of-range parameters), which I have confirmed to match the color parsing on a real VT240 terminal.
claunia added the pull-request label 2026-01-31 09:34:43 +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#29409