diff --git a/Shell/Builtin.cpp b/Shell/Builtin.cpp index 9c2ab6d06f..a0a7c539c4 100644 --- a/Shell/Builtin.cpp +++ b/Shell/Builtin.cpp @@ -98,6 +98,7 @@ int Shell::builtin_bg(int argc, const char** argv) } job->set_running_in_background(true); + job->set_should_announce_exit(true); job->set_is_suspended(false); dbgln("Resuming {} ({})", job->pid(), job->cmd()); diff --git a/Shell/Shell.cpp b/Shell/Shell.cpp index 6d4123b21f..871c8df938 100644 --- a/Shell/Shell.cpp +++ b/Shell/Shell.cpp @@ -871,6 +871,8 @@ RefPtr Shell::run_command(const AST::Command& command) job->on_exit = [this](auto job) { if (!job->exited()) return; + + restore_ios(); if (job->is_running_in_background() && job->should_announce_exit()) warnln("Shell: Job {} ({}) exited\n", job->job_id(), job->cmd().characters()); else if (job->signaled() && job->should_announce_signal())