Add support for querying DECAC with DECRQSS #17465

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

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

Description of the new feature/enhancement

This is a follow-up to PR #13058. Ideally we should be able to query the state of the DECAC color assignments using a DECRQSS query, so if an application changes those values, it can also restore them to what they were initially.

Proposed technical implementation details (optional)

The problem here is that DECAC works differently from most other DECRQSS queries. Typically there is only one potential response for a query, but in the case of DECAC we need to know whether to return the Normal Text colors, or the Window Frame colors.

This is what the VT525 manual has to say on the subject:

DECAC can be reported using DECRQSS and DECRPSS. Use Ps1 in DECRQSS to select the item to be reported.

But it's not clear to me what that means. Is the Ps1 meant to be included as a parameter value following the DCS introducer, or within the actual body of the string data? For example, if you're querying the window frame (color item 2), do you use this:

\eP2$q,|\e\\

or this:

\eP$q2,|\e\\

Of the modern terminal emulators I've tested, only three support DECAC in any capacity, and only two of those respond to a DECRQSS query for DECAC, but not in the same way. If I was forced to make a choice, I'd likely go with the second option, but I'm hoping we can get confirmation of the correct behavior from someone with a VT525.

Originally created by @j4james on GitHub (May 13, 2022). # Description of the new feature/enhancement This is a follow-up to PR #13058. Ideally we should be able to query the state of the `DECAC` color assignments using a `DECRQSS` query, so if an application changes those values, it can also restore them to what they were initially. # Proposed technical implementation details (optional) The problem here is that `DECAC` works differently from most other `DECRQSS` queries. Typically there is only one potential response for a query, but in the case of `DECAC` we need to know whether to return the _Normal Text_ colors, or the _Window Frame_ colors. This is what the VT525 manual has to say on the subject: > `DECAC` can be reported using `DECRQSS` and `DECRPSS`. Use **Ps1** in `DECRQSS` to select the item to be reported. But it's not clear to me what that means. Is the **Ps1** meant to be included as a parameter value following the `DCS` introducer, or within the actual body of the string data? For example, if you're querying the window frame (color item 2), do you use this: \eP2$q,|\e\\ or this: \eP$q2,|\e\\ Of the modern terminal emulators I've tested, only three support `DECAC` in any capacity, and only two of those respond to a `DECRQSS` query for `DECAC`, but not in the same way. If I was forced to make a choice, I'd likely go with the second option, but I'm hoping we can get confirmation of the correct behavior from someone with a VT525.
claunia added the Help WantedProduct-ConhostIssue-TaskIn-PRArea-VTNeeds-Tag-Fix labels 2026-01-31 05:43:20 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17465