Skip to content

Commit 0f5b1f4

Browse files
committed
fix: Check if console input is redirected before reading
1 parent c8d0c57 commit 0f5b1f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Runly/Hosting/RunAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public async Task RunAsync(CancellationToken token)
106106
{
107107
Console.Write($"\rRunning {execution.Job.GetType().Name}: {execution.CompletedItemCount} items{(execution.TotalItemCount.HasValue ? " of " + execution.TotalItemCount.Value : string.Empty)} processed. {(!jobCancellation.IsCancellationRequested ? "Press 'q' to quit." : "Quitting... ")}");
108108

109-
while (!jobCancellation.IsCancellationRequested && Console.KeyAvailable)
109+
while (!jobCancellation.IsCancellationRequested && !Console.IsInputRedirected && Console.KeyAvailable)
110110
{
111111
var key = Console.ReadKey();
112112

0 commit comments

Comments
 (0)