mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 08:52:50 +08:00
Fix potential deadlock when cancelling prompts (#1439)
This commit is contained in:
parent
63c22575ea
commit
71631b248a
@ -19,6 +19,7 @@ public static partial class AnsiConsoleExtensions
|
|||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
var rawKey = await console.Input.ReadKeyAsync(true, cancellationToken).ConfigureAwait(false);
|
var rawKey = await console.Input.ReadKeyAsync(true, cancellationToken).ConfigureAwait(false);
|
||||||
if (rawKey == null)
|
if (rawKey == null)
|
||||||
{
|
{
|
||||||
|
@ -48,6 +48,7 @@ internal sealed class ListPrompt<T>
|
|||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
var rawKey = await _console.Input.ReadKeyAsync(true, cancellationToken).ConfigureAwait(false);
|
var rawKey = await _console.Input.ReadKeyAsync(true, cancellationToken).ConfigureAwait(false);
|
||||||
if (rawKey == null)
|
if (rawKey == null)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user