diff --git a/src/Spectre.Console/Extensions/AnsiConsoleExtensions.Input.cs b/src/Spectre.Console/Extensions/AnsiConsoleExtensions.Input.cs index f7ec487a2..f5299adde 100644 --- a/src/Spectre.Console/Extensions/AnsiConsoleExtensions.Input.cs +++ b/src/Spectre.Console/Extensions/AnsiConsoleExtensions.Input.cs @@ -19,6 +19,7 @@ internal static async Task ReadLine(this IAnsiConsole console, Style? st while (true) { + cancellationToken.ThrowIfCancellationRequested(); var rawKey = await console.Input.ReadKeyAsync(true, cancellationToken).ConfigureAwait(false); if (rawKey == null) { diff --git a/src/Spectre.Console/Prompts/List/ListPrompt.cs b/src/Spectre.Console/Prompts/List/ListPrompt.cs index 5db80c2d2..398a31535 100644 --- a/src/Spectre.Console/Prompts/List/ListPrompt.cs +++ b/src/Spectre.Console/Prompts/List/ListPrompt.cs @@ -48,6 +48,7 @@ public async Task> Show( while (true) { + cancellationToken.ThrowIfCancellationRequested(); var rawKey = await _console.Input.ReadKeyAsync(true, cancellationToken).ConfigureAwait(false); if (rawKey == null) {