[PR #13969] Make sure Terminal state machine always accepts C1 controls #29874

Closed
opened 2026-01-31 09:37:22 +00:00 by claunia · 0 comments
Owner

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

State: closed
Merged: Yes


When we added support for the DECAC1 control sequence, which
determines whether C1 controls are accepted or not, the intention was
that conhost would be making that determination, and Windows Terminal
would always be expected to accept any passed-through C1 controls.

However, this didn't take into account that a passed-through RIS
sequence could end up disabling DECAC1, and that would leave Windows
Terminal incapable of processing any C1 controls. This PR attempts to
fix that oversight.

The DECAC1 sequence was added in PR #11690, when we disabled C1
acceptance by default.

This is a bit of a hack, but I've added a new AlwaysAcceptC1 mode to
the state machine, which is enabled at startup in the Terminal, and is
never disabled. The parser then just needs to check whether either
AcceptC1 or AlwaysAcceptC1 are set.

Validation Steps Performed

I've manually confirmed the test case in #13968 now works as expected.

Closes #13968

**Original Pull Request:** https://github.com/microsoft/terminal/pull/13969 **State:** closed **Merged:** Yes --- When we added support for the `DECAC1` control sequence, which determines whether `C1` controls are accepted or not, the intention was that conhost would be making that determination, and Windows Terminal would always be expected to accept any passed-through `C1` controls. However, this didn't take into account that a passed-through `RIS` sequence could end up disabling `DECAC1`, and that would leave Windows Terminal incapable of processing any `C1` controls. This PR attempts to fix that oversight. The `DECAC1` sequence was added in PR #11690, when we disabled `C1` acceptance by default. This is a bit of a hack, but I've added a new `AlwaysAcceptC1` mode to the state machine, which is enabled at startup in the Terminal, and is never disabled. The parser then just needs to check whether either `AcceptC1` or `AlwaysAcceptC1` are set. ## Validation Steps Performed I've manually confirmed the test case in #13968 now works as expected. Closes #13968
claunia added the pull-request label 2026-01-31 09:37:22 +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#29874