From a5a5ccb73db7884e0f0a084a134dc12c30336ec7 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Fri, 24 May 2019 17:27:20 -0700 Subject: [PATCH] Revert "exec: If a job includes a builtin, it stays in our pgroup" This reverts commit 711260593cff402d4ddac8703cce17b103d387d1. This ended up breaking the tests; moreover it may have other problems like preventing backgrounding. Reopens #5855 --- src/exec.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/exec.cpp b/src/exec.cpp index 06e699c83..9ccac5cb8 100644 --- a/src/exec.cpp +++ b/src/exec.cpp @@ -1019,19 +1019,6 @@ bool exec_job(parser_t &parser, shared_ptr j) { j->set_flag(job_flag_t::JOB_CONTROL, true); } - // If there's a builtin in the pipeline, - // we let the whole job stay in our pgroup. - // This fixes `builtin history | less`, and still lets `read | cat` and `cat | read` work. - // (Note that bash forks for the builtin in these cases, but that's also why its `read` often can't communicate variables back) - if (j->pgid == INVALID_PID) { - for (const auto& proc : j->processes) { - if (proc->type == process_type_t::builtin) { - j->pgid = getpgrp(); - break; - } - } - } - size_t stdout_read_limit = 0; io_chain_t all_ios = j->all_io_redirections();