-
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
Fix the DECTCEM reset position in the conpty stream #17148
Merged
Merged
Conversation
This file contains 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
microsoft-github-policy-service
bot
added
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Area-VT
Virtual Terminal sequence support
Product-Conpty
For console issues specifically related to conpty
labels
Apr 27, 2024
lhecker
approved these changes
Apr 28, 2024
zadjii-msft
approved these changes
Apr 29, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yea that's an obvious bug for sure
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 29, 2024
## Summary of the Pull Request When the conpty renderer determines that it needs to hide the cursor, it does so by inserting a `DECTCEM` reset sequence at the start of the output buffer, assuming that is the start of the frame. But when the `_noFlushOnEnd` flag is set, you can have multiple frames pending in the buffer, and the `DECTCEM` sequence will then end up in the wrong place. This PR fixes the issue by saving the buffer size at the start of the frame, and using that saved offset as the insert position for the `DECTCEM` sequence. ## Validation Steps Performed I have a game that was frequently affected by this issue (the cursor would be visible when it was meant to be hidden). With this PR applied, it now works perfectly. ## PR Checklist - [x] Closes #15449
DHowett
reviewed
Apr 29, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excellent catch, thanks!
DHowett
pushed a commit
that referenced
this pull request
Apr 30, 2024
## Summary of the Pull Request When the conpty renderer determines that it needs to hide the cursor, it does so by inserting a `DECTCEM` reset sequence at the start of the output buffer, assuming that is the start of the frame. But when the `_noFlushOnEnd` flag is set, you can have multiple frames pending in the buffer, and the `DECTCEM` sequence will then end up in the wrong place. This PR fixes the issue by saving the buffer size at the start of the frame, and using that saved offset as the insert position for the `DECTCEM` sequence. ## Validation Steps Performed I have a game that was frequently affected by this issue (the cursor would be visible when it was meant to be hidden). With this PR applied, it now works perfectly. ## PR Checklist - [x] Closes #15449 (cherry picked from commit ef318a1) Service-Card-Id: 92457089 Service-Version: 1.19
DHowett
pushed a commit
that referenced
this pull request
Apr 30, 2024
## Summary of the Pull Request When the conpty renderer determines that it needs to hide the cursor, it does so by inserting a `DECTCEM` reset sequence at the start of the output buffer, assuming that is the start of the frame. But when the `_noFlushOnEnd` flag is set, you can have multiple frames pending in the buffer, and the `DECTCEM` sequence will then end up in the wrong place. This PR fixes the issue by saving the buffer size at the start of the frame, and using that saved offset as the insert position for the `DECTCEM` sequence. ## Validation Steps Performed I have a game that was frequently affected by this issue (the cursor would be visible when it was meant to be hidden). With this PR applied, it now works perfectly. ## PR Checklist - [x] Closes #15449 (cherry picked from commit ef318a1) Service-Card-Id: 92457090 Service-Version: 1.20
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area-VT
Virtual Terminal sequence support
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Product-Conpty
For console issues specifically related to conpty
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.
Summary of the Pull Request
When the conpty renderer determines that it needs to hide the cursor,
it does so by inserting a
DECTCEM
reset sequence at the start of theoutput buffer, assuming that is the start of the frame. But when the
_noFlushOnEnd
flag is set, you can have multiple frames pending in thebuffer, and the
DECTCEM
sequence will then end up in the wrong place.This PR fixes the issue by saving the buffer size at the start of the
frame, and using that saved offset as the insert position for the
DECTCEM
sequence.Validation Steps Performed
I have a game that was frequently affected by this issue (the cursor
would be visible when it was meant to be hidden). With this PR applied,
it now works perfectly.
PR Checklist