{{ message }}
Avoid window events during ASB - #20617
Open
Leonard Hecker (lhecker) wants to merge 3 commits into
Open
Conversation
Comment on lines
-656
to
-657
Member
Author
There was a problem hiding this comment.
Last famous words.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Important context: To make a window smaller programmatically,
the win32 console APIs have since forever required you to
To make the window larger you had to
This is because a viewport had to fit into the buffer and vice versa.
ConEmu was very popular in the past and used this to implement proper
terminals around conhost. When WSL came along this resulted in a
problem: It wants SIGWINCH-style notifications. And there are none
on Windows. A long time ago, a hack was introduced that simply
raised buffer size events on any viewport size changes.
The problem: It was raised for any viewport size changes.
And it was also raised for ASB switching.
Problema numero due: OpenSSH for WIndows is like WSL, but it has a
severe bug: A SIGWINCH during a partial input read will corrupt the
read and the other side will read either garbage or duplicate input.
Well, we can fix that by just not raising buffer size events.
It's very dangerous, because it may easily regress ConEmu (etc.).
See: PowerShell/Win32-OpenSSH#2275
Also: Fun fact, we've been ignoring
ENABLE_WINDOW_INPUTsince Windows 1607! No way fixing this breaks anything! /s
So, this PR introduces two regressions:
ENABLE_WINDOW_INPUTis being respected againWINDOW_BUFFER_SIZE_EVENTis not sent anymorewhen the viewport changes if VT mode disabled
Changes:
ENABLE_WINDOW_INPUTThis is part of #281.
Validation Steps Performed
ConEmuC64.exe -AUTOATTACH -GHWND=NEWwsl -- bashwhile stty size; do read -rt .05 ||:; done