mirror of
https://github.com/spectreconsole/spectre.console.git
synced 2025-10-25 15:19:23 +00:00
Fix potential deadlock when cancelling prompts (#1439)
This commit is contained in:
@@ -19,6 +19,7 @@ public static partial class AnsiConsoleExtensions
|
||||
|
||||
while (true)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
var rawKey = await console.Input.ReadKeyAsync(true, cancellationToken).ConfigureAwait(false);
|
||||
if (rawKey == null)
|
||||
{
|
||||
|
||||
@@ -48,6 +48,7 @@ internal sealed class ListPrompt<T>
|
||||
|
||||
while (true)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
var rawKey = await _console.Input.ReadKeyAsync(true, cancellationToken).ConfigureAwait(false);
|
||||
if (rawKey == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user