Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure Terminal state machine always accepts C1 controls #13969

Merged
1 commit merged into from
Sep 12, 2022

Conversation

j4james
Copy link
Collaborator

@j4james j4james commented Sep 12, 2022

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

@ghost ghost added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Sep 12, 2022
@j4james j4james marked this pull request as ready for review September 12, 2022 01:06
@DHowett DHowett added the AutoMerge Marked for automatic merge by the bot when requirements are met label Sep 12, 2022
@ghost
Copy link

ghost commented Sep 12, 2022

Hello @DHowett!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outstanding. Thanks! I love small diffs. :D

@ghost ghost merged commit f2b361c into microsoft:main Sep 12, 2022
@j4james j4james deleted the fix-decac1-reset branch September 13, 2022 21:13
DHowett pushed a commit that referenced this pull request Dec 12, 2022
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

(cherry picked from commit f2b361c)
Service-Card-Id: 87207769
Service-Version: 1.15
DHowett pushed a commit that referenced this pull request Dec 12, 2022
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

(cherry picked from commit f2b361c)
Service-Card-Id: 87207767
Service-Version: 1.16
@ghost
Copy link

ghost commented Dec 14, 2022

🎉Windows Terminal v1.15.3465.0 and v1.15.3466.0 has been released which incorporates this pull request.:tada:

Handy links:

@ghost
Copy link

ghost commented Dec 14, 2022

🎉Windows Terminal Preview v1.16.3463.0 and v1.16.3464.0 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reset disables the ability to pass through C1 control characters
3 participants