mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-04 10:35:27 +08: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