mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-28 01:11:15 -03:00
More aggressively inherit pgrps from parent jobs
Prior to this fix, a job would only inherit a pgrp from its parent if the first command were external. There seems to be no reason for this restriction and this causes tcsetgrp() churn, potentially cuasing SIGTTIN. Switch to unconditionally inheriting a pgrp from parents. This should fix most of #5765, the only remaining question is tcsetpgrp from builtins.
This commit is contained in:
@@ -1027,11 +1027,9 @@ bool exec_job(parser_t &parser, shared_ptr<job_t> j) {
|
||||
const std::shared_ptr<job_t> parent_job = j->get_parent();
|
||||
|
||||
// Perhaps inherit our parent's pgid and job control flag.
|
||||
if (parent_job && j->processes.front()->type == process_type_t::external) {
|
||||
if (parent_job->pgid != INVALID_PID) {
|
||||
j->pgid = parent_job->pgid;
|
||||
j->set_flag(job_flag_t::JOB_CONTROL, true);
|
||||
}
|
||||
if (parent_job && parent_job->pgid != INVALID_PID) {
|
||||
j->pgid = parent_job->pgid;
|
||||
j->set_flag(job_flag_t::JOB_CONTROL, true);
|
||||
}
|
||||
|
||||
size_t stdout_read_limit = 0;
|
||||
|
||||
Reference in New Issue
Block a user