mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +00:00
Shell: Cancel a running for loop upon receiving any non-SIGINT signal
And keep the old behaviour of needing two interruptions on SIGINT.
This commit is contained in:
committed by
Andreas Kling
parent
d777583e28
commit
69fc91d974
@@ -777,13 +777,15 @@ RefPtr<Value> ForLoop::run(RefPtr<Shell> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user