diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp index ca51af64c8..5d7006a614 100644 --- a/Userland/Shell/Shell.cpp +++ b/Userland/Shell/Shell.cpp @@ -1079,17 +1079,18 @@ void Shell::block_on_job(RefPtr job) } } }; - Core::EventLoop loop; + bool job_exited { false }; job->on_exit = [&, old_exit = move(job->on_exit)](auto job) { if (old_exit) old_exit(job); - loop.quit(0); + job_exited = true; }; if (job->exited()) return; - loop.exec(); + while (!job_exited) + Core::EventLoop::current().pump(); // If the job is part of a pipeline, wait for the rest of the members too. if (auto command = job->command_ptr())