Fix potential deadlock when cancelling prompts (#1439)

This commit is contained in:
Caelan Sayler 2024-01-31 11:02:01 +00:00 committed by GitHub
parent 63c22575ea
commit 71631b248a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -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)
{

View File

@ -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)
{