ConPTY: Avoid WINDOW_BUFFER_SIZE_EVENT when the viewport moves#15935
Merged
microsoft-github-policy-service[bot] merged 2 commits intomainfrom Sep 18, 2023
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
Member
|
Wait does this do anything about #281? |
carlos-zamora
approved these changes
Sep 6, 2023
Member
carlos-zamora
left a comment
There was a problem hiding this comment.
Thanks for mentioning and briefly going over this in Triage 😊
Member
Author
No, that'd be a breaking change at this point, so this PR just avoids calling |
zadjii-msft
approved these changes
Sep 18, 2023
zadjii-msft
approved these changes
Sep 18, 2023
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.
SetConsoleWindowInfoImplcallsPostUpdateWindowSize, which emits aCM_SET_WINDOW_SIZEevent, which causes_InternalSetWindowSizeto becalled, which calls
ScreenBufferSizeChangewhich then finally emits aWINDOW_BUFFER_SIZE_EVENTevent into the client input buffer.This messes up applications like which make use of
WINDOW_BUFFER_SIZE_EVENTto perform potentially lossy operations.In case of SSH this results in a resize (SIGWINCH) of the server-side
screen which similarly may result in a response by the shell, etc.
Since that happens over networks and is async, and because our conhost
VT viewport implementation appears to have a number of subtle bugs,
this results in duplicate output lines (sometimes hundreds).
Under Windows Terminal this issue is not as apparent, since ConPTY has
no viewport that can be moved and no scrollback. It only appears as an
issue if a terminal application reacts poorly to the SIGWINCH event.
Closes #15769
Validation Steps Performed
SynthesizeWindowBufferSizeEventNo calls to
SynthesizeWindowBufferSizeEvent✅tput resetInput line moves to row 0 ✅