mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 08:35:09 +00:00
Shell: Avoid waiting for jobs that were *just* unblocked
This fixes the issue with C-z not suspending the job on the first try. ...and further signal issues when the suspended job is contiued.
This commit is contained in:
parent
46661f02c6
commit
dc62371439
4 changed files with 14 additions and 4 deletions
|
@ -561,16 +561,18 @@ Vector<RefPtr<Job>> Shell::run_commands(Vector<AST::Command>& commands)
|
|||
}
|
||||
#endif
|
||||
auto job = run_command(command);
|
||||
if (!job)
|
||||
continue;
|
||||
|
||||
if (command.should_wait) {
|
||||
block_on_job(job);
|
||||
jobs_to_wait_for.append(job);
|
||||
if (!job->is_suspended())
|
||||
jobs_to_wait_for.append(job);
|
||||
} else {
|
||||
if (command.is_pipe_source) {
|
||||
jobs_to_wait_for.append(job);
|
||||
} else if (command.should_notify_if_in_background) {
|
||||
if (job)
|
||||
job->set_running_in_background(true);
|
||||
job->set_running_in_background(true);
|
||||
restore_stdin();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue