From 7b5ead64a5584df317c81cc5935c4e09976707a6 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Tue, 1 Sep 2020 19:03:19 +0430 Subject: [PATCH] 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 :^) --- Shell/AST.cpp | 2 +- Shell/Shell.cpp | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Shell/AST.cpp b/Shell/AST.cpp index 658494982e..ebbc783a9d 100644 --- a/Shell/AST.cpp +++ b/Shell/AST.cpp @@ -73,7 +73,7 @@ static inline Vector join_commands(Vector left, Vector commands; commands.append(left); diff --git a/Shell/Shell.cpp b/Shell/Shell.cpp index 77a1459445..a598cffc1f 100644 --- a/Shell/Shell.cpp +++ b/Shell/Shell.cpp @@ -699,11 +699,9 @@ NonnullRefPtrVector Shell::run_commands(Vector& 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) return; loop.exec(); - - if (job->is_suspended()) - job->print_status(Job::PrintStatusMode::Basic); } String Shell::get_history_path()