We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b536aff commit d33ddeaCopy full SHA for d33ddea
src/PowerShellEditorServices/Console/ConsoleReadLine.cs
@@ -487,6 +487,19 @@ private async Task<ConsoleKeyInfo> ReadKeyAsync(CancellationToken cancellationTo
487
}
488
else
489
{
490
+ // Check to see if a key is available.
491
+ // If not check for cancellation requested.
492
+ while (!Console.KeyAvailable)
493
+ {
494
+ if (cancellationToken.IsCancellationRequested)
495
496
+ //this.bufferedKey = keyInfo;
497
+ throw new TaskCanceledException();
498
+ }
499
+
500
+ Thread.Sleep(100);
501
502
503
keyInfo = Console.ReadKey(true);
504
505
if (cancellationToken.IsCancellationRequested)
0 commit comments