Add support for DECSCNM in Windows Terminal #9188

Open
opened 2026-01-31 01:48:17 +00:00 by claunia · 0 comments
Owner

Originally created by @j4james on GitHub (Jun 21, 2020).

Description of the new feature/enhancement

When the DECSCNM mode was implemented in PR #3817, it was only actually added to conhost, but relied on the fact that the conpty renderer was passing through the translated colors (rather than the underlying buffer values), so it gave the impression that it worked in Windows Terminal as well. Once PR #6506 is merged, though, this will no longer be the case, so we need to add explicit support for DECSCNM in WT if we want to retain that functionality.

Proposed technical implementation details (optional)

In the conhost AdaptDispatch, we need to return false from the SetScreenMode method (when in conpty mode), to force the DECSCNM sequence to be passed through to the conpty pipe. Then on the WT side, we need to duplicate a lot of the AdaptDispatch implementation in TerminalDispatch, and update the renderdata GetForegroundColor and GetBackgroundColor calculations to take the reversed screen mode into account.

Originally created by @j4james on GitHub (Jun 21, 2020). # Description of the new feature/enhancement When the `DECSCNM` mode was implemented in PR #3817, it was only actually added to conhost, but relied on the fact that the conpty renderer was passing through the translated colors (rather than the underlying buffer values), so it gave the impression that it worked in Windows Terminal as well. Once PR #6506 is merged, though, this will no longer be the case, so we need to add explicit support for `DECSCNM` in WT if we want to retain that functionality. # Proposed technical implementation details (optional) In the conhost `AdaptDispatch`, we need to return false from the `SetScreenMode` method (when in conpty mode), to force the `DECSCNM` sequence to be passed through to the conpty pipe. Then on the WT side, we need to duplicate a lot of the `AdaptDispatch` implementation in `TerminalDispatch`, and update the renderdata `GetForegroundColor` and `GetBackgroundColor` calculations to take the reversed screen mode into account.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9188