From cd8268e6fb20e2118929af5928c9d3fa1bbe6159 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Mon, 7 Dec 2020 00:47:21 +0330 Subject: [PATCH] Shell: Put background jobs into new process groups too Fixes #4345. This was done in 54b453b in the name of "fixing event loop processing in subshells", but I do not see how a new PGID is supposed to affect the event loop. This seems to have been done by mistake, let's see if any tests fail because of this. --- Shell/Shell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shell/Shell.cpp b/Shell/Shell.cpp index fda9540bd3..a1249786c5 100644 --- a/Shell/Shell.cpp +++ b/Shell/Shell.cpp @@ -816,7 +816,7 @@ RefPtr Shell::run_command(const AST::Command& command) } pid_t pgid = is_first ? child : (command.pipeline ? command.pipeline->pgid : child); - if ((!m_is_subshell && command.should_wait) || command.pipeline) { + if (!m_is_subshell || command.pipeline) { if (setpgid(child, pgid) < 0 && m_is_interactive) perror("setpgid");