Add support for the VT525 restore color table sequence #17520

Open
opened 2026-01-31 05:44:56 +00:00 by claunia · 0 comments
Owner

Originally created by @j4james on GitHub (May 20, 2022).

Description of the new feature/enhancement

The VT525 terminal had a pair of sequences for saving and restoring terminal state: the DECRQTSR sequence could be used to request a state report from the terminal which an application could save; and then the DECRSTS sequences would be used to restore that saved data to the terminal, returning it to the state it was originally.

There are two kinds of reports supported by these sequences:

  1. the "terminal state report", which contains most of the settable attributes, excluding large items like the DRCS fonts, and macro definitions.
  2. the "color table report", which contains the color definitions for all of the palette entries in the color table.

What I'm proposing is that we add support for the color table report, but only the restore operation (for now).

The one reason I'd like to add this is so we have standard-compliant way to alter the palette. The second reason is that it will give me a chance to introduce the color conversion routines that will eventually be required for sixel.

Proposed technical implementation details (optional)

DECRSTS is a DCS sequence, which can't pass through conpty, so for now this would only work on conhost, or using the experimental passthrough mode in Windows Terminal. That said, I am planning to try and add support for DCS over a regular conpty connection at some point (at least for simple cases like this). But I'm not proposing to do that now.

Originally created by @j4james on GitHub (May 20, 2022). # Description of the new feature/enhancement The VT525 terminal had a pair of sequences for saving and restoring terminal state: the `DECRQTSR` sequence could be used to request a state report from the terminal which an application could save; and then the `DECRSTS` sequences would be used to restore that saved data to the terminal, returning it to the state it was originally. There are two kinds of reports supported by these sequences: 1. the "terminal state report", which contains most of the settable attributes, excluding large items like the DRCS fonts, and macro definitions. 2. the "color table report", which contains the color definitions for all of the palette entries in the color table. What I'm proposing is that we add support for the color table report, but only the restore operation (for now). The one reason I'd like to add this is so we have standard-compliant way to alter the palette. The second reason is that it will give me a chance to introduce the color conversion routines that will eventually be required for sixel. # Proposed technical implementation details (optional) `DECRSTS` is a `DCS` sequence, which can't pass through conpty, so for now this would only work on conhost, or using the experimental passthrough mode in Windows Terminal. That said, I am planning to try and add support for `DCS` over a regular conpty connection at some point (at least for simple cases like this). But I'm not proposing to do that now.
claunia added the Issue-FeatureNeeds-TriageResolution-Fix-CommittedNeeds-Tag-Fix labels 2026-01-31 05:44:57 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17520