diff --git a/Shell/AST.cpp b/Shell/AST.cpp index 64a9ef86ca1..be8d600d695 100644 --- a/Shell/AST.cpp +++ b/Shell/AST.cpp @@ -777,13 +777,15 @@ RefPtr ForLoop::run(RefPtr shell) if (!job || job->is_running_in_background()) continue; shell->block_on_job(job); - if (job->signaled() - && (job->termination_signal() == SIGINT - || job->termination_signal() == SIGKILL - || job->termination_signal() == SIGQUIT)) - ++consecutive_interruptions; - else + + if (job->signaled()) { + if (job->termination_signal() == SIGINT) + ++consecutive_interruptions; + else + break; + } else { consecutive_interruptions = 0; + } } }