-
Notifications
You must be signed in to change notification settings - Fork 230
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
Re-workaround uncancellable Console.ReadKey
#1751
Conversation
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.
LGTM, this is just removing dead code and stripping out UnixConsoleEcho yeah?
So far, yeah. |
Oh right WIP OOPS 😁 |
This "rewrite" uses the `console.sendText()` API in VS Code to respond to a notification and send a fake key press, allowing us to "cancel" `ReadKey` by getting it to return. Since we know we requested the cancellation, we just drop the fake key press. This means we no longer have to poll on macOS/Linux, and no longer have the ghost "double key-press" issue on Windows. This fixes a myriad of problems and opens up a lot of simplification.
So much simpler.
430f6f6
to
9fa13a2
Compare
Console.ReadKey
Console.ReadKey
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.
LGTM! Just a couple of small things.
Well done, this is super exciting ❤️
Just going to approve, if you have auto merge on nbd
src/PowerShellEditorServices/Services/PowerShell/Console/ConsoleProxy.cs
Outdated
Show resolved
Hide resolved
src/PowerShellEditorServices/Services/PowerShell/Console/ConsoleProxy.cs
Outdated
Show resolved
Hide resolved
src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs
Outdated
Show resolved
Hide resolved
src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs
Outdated
Show resolved
Hide resolved
e3278a8
to
7c97b9a
Compare
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.
LGTM!
Yay! Thanks @SeeminglyScience. Merging. |
First pulled out the old native
UnixConsoleEcho
and I think finished #1745, then removed all theReadKeyAsync
code that was unreferenced. Currently testing using theKeyAvailable
workaround on Windows, and testing the bufferedReadKey
workaround on macOS. They're both broken in different ways 🤷