-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Reset disables the ability to pass through C1 control characters #13968
Comments
I think this may be another regression from #13024. When we first added support for I haven't tried this yet, but one simple fix could be to add another parser mode - something like
It's a bit hacky, but that should add no significant overhead, and we won't then have to care what |
Ah, this is a weird case. Great catch! Eventually we would want to turn that new "always" flag off by default, because there may not always be a guarantee that Terminal is connected to ConPTY. I'm cool with this fix, if we file a followup/todo somewhere. Quick question: does this mean a hard reset breaks Terminal in general? Should I crack the seal on the coming 1.15 and 1.16 releases to slip in a fix for this? 🙂 (Edit: oh, C1 isn't the common case for ConPTY. You're safe to ignore a bunch of the concerns here. Thanks!) |
Yeah. We've actually already got a comment in the code at that point. terminal/src/cascadia/TerminalCore/Terminal.cpp Lines 88 to 89 in d11ea72
Only if someone is actually using C1 controls, which requires actively enabling them with |
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
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
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
🎉This issue was addressed in #13969, which has now been successfully released as Handy links: |
🎉This issue was addressed in #13969, which has now been successfully released as Handy links: |
Windows Terminal version
1.15.1862.0
Windows build number
10.0.19044.1889
Other Software
No response
Steps to reproduce
printf "\e 7\u009B?5h"
reset
to get the screen back to normal.printf "\e 7\u009B?5h"
again.Expected Behavior
Both step 2 and step 5 should cause the screen attributes to be reversed.
Actual Behavior
Only the first attempt works. The second attempt appears to output
?5h
instead.What's happening is we've got a
DECAC1
sequence (ESC SP 7
) which is supposed to enableC1
support, followed byDECSCNM
(reverse screen mode), using aC1
control sequence (CSI ? 5 h
).That works the first time, but after the reset, the
C1
support is permanently disabled on the conpty client side, soC1
control sequences can no longer be passed through.The text was updated successfully, but these errors were encountered: