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

Don't SetCursorPosition when not Rendered. #1141

Merged
merged 1 commit into from
Nov 9, 2019

Conversation

msftrncs
Copy link
Collaborator

@msftrncs msftrncs commented Nov 1, 2019

Block the setting of the console cursor when the buffer hasn't been completely rendered due to an input queue waiting to be processed.

Context: #1081 (comment)

Fixes #1081.

@lzybkr
Copy link
Member

lzybkr commented Nov 1, 2019

Nice job tracking down this issue.

It sounds like if we detect a simulated paste and convert that to a real paste (#579), we could avoid processing any keys that might move the cursor before rendering.

Then again, a fix for #579 might not be 100% reliable and this fix is still necessary, it's hard to say for sure.

@msftrncs
Copy link
Collaborator Author

msftrncs commented Nov 1, 2019

Also, I think Windows Terminal plans to fix the paste behavior regarding the CTRL-ENTER being pasted (there is a PR for it) and with that, the issue this fixes becomes hard to reproduce again.

@msftrncs
Copy link
Collaborator Author

msftrncs commented Nov 1, 2019

I am still getting another exception signature if I find the right material to paste, and I think that is related to #1083. It involves when the cursor ends up going off the top of the buffer, in this case, during the paste due to the excessive CTRL-ENTER's filling up the bottom of the buffer. To fix that, would really require being able to render a partial buffer other than just at the end.

@msftrncs
Copy link
Collaborator Author

msftrncs commented Nov 8, 2019

Noting a merge conflict will occur with #1146.

Block the setting of the console cursor when the buffer hasn't been
completely rendered due to an input queue waiting to be processed.

Fixes PowerShell#1081.
@daxian-dbw daxian-dbw merged commit 4576a77 into PowerShell:master Nov 9, 2019
@msftrncs msftrncs deleted the FixFor1081 branch November 9, 2019 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copying and pasting a comment raised an exception, until I ran Clear-Host
3 participants