1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 08:25:07 +00:00

Shell: Announce job events at the right times

This fixes a duplicate message when running `jobs` for the first time
after a job has been moved to the background.
Also actually announces background exits now :^)
This commit is contained in:
AnotherTest 2020-09-01 19:03:19 +04:30 committed by Andreas Kling
parent 715e11f692
commit 7b5ead64a5
2 changed files with 3 additions and 8 deletions

View file

@ -699,11 +699,9 @@ NonnullRefPtrVector<Job> Shell::run_commands(Vector<AST::Command>& commands)
if (command.should_wait) {
block_on_job(job);
} else {
if (command.is_pipe_source) {
job->set_running_in_background(true);
} else if (command.should_notify_if_in_background) {
job->set_running_in_background(true);
if (!command.is_pipe_source && command.should_notify_if_in_background)
job->set_should_announce_exit(true);
}
}
}
@ -759,9 +757,6 @@ void Shell::block_on_job(RefPtr<Job> job)
return;
loop.exec();
if (job->is_suspended())
job->print_status(Job::PrintStatusMode::Basic);
}
String Shell::get_history_path()