Skip to content

Commit d33ddea

Browse files
committed
Attempt to fix issue with stepping in dbgr on Linux
Fix PowerShell#554
1 parent b536aff commit d33ddea

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/PowerShellEditorServices/Console/ConsoleReadLine.cs

+13
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,19 @@ private async Task<ConsoleKeyInfo> ReadKeyAsync(CancellationToken cancellationTo
487487
}
488488
else
489489
{
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+
490503
keyInfo = Console.ReadKey(true);
491504

492505
if (cancellationToken.IsCancellationRequested)

0 commit comments

Comments
 (0)