From fe60f2ef167a0c677842c1be4e662c342286b2d9 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 8 Feb 2020 14:40:06 -0800 Subject: [PATCH] Move root_has_job_control from lineage to job_tree Whether we have job control is a property of the job tree, not of individual jobs. Reflect that fact directly by moving it into the job tree. --- src/exec.cpp | 1 - src/parse_execution.cpp | 2 +- src/proc.h | 4 ---- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/exec.cpp b/src/exec.cpp index 1d1c00db0..d85fe865a 100644 --- a/src/exec.cpp +++ b/src/exec.cpp @@ -663,7 +663,6 @@ static proc_performer_t get_performer_for_process(process_t *p, job_t *job, lineage.job_tree = job->job_tree; lineage.block_io = io_chain; lineage.root_constructed = job->root_constructed; - lineage.root_has_job_control = job->wants_job_control(); if (p->type == process_type_t::block_node) { const parsed_source_ref_t &source = p->block_node_source; diff --git a/src/parse_execution.cpp b/src/parse_execution.cpp index 459bf3eef..a43aa23fa 100644 --- a/src/parse_execution.cpp +++ b/src/parse_execution.cpp @@ -1251,7 +1251,7 @@ end_execution_reason_t parse_execution_context_t::run_1_job(tnode_t job_ bool wants_job_control = (job_control_mode == job_control_t::all) || ((job_control_mode == job_control_t::interactive) && parser->is_interactive()) || - lineage.root_has_job_control; + (lineage.job_tree && lineage.job_tree->wants_job_control()); job_t::properties_t props{}; props.wants_terminal = wants_job_control && !ld.is_event; diff --git a/src/proc.h b/src/proc.h index 8085e3e37..799ae80b4 100644 --- a/src/proc.h +++ b/src/proc.h @@ -335,10 +335,6 @@ struct job_lineage_t { /// is part of a pipeline, then this may be set. job_tree_ref_t job_tree{}; - /// Whether job control is on for the root. - /// This is set if our job is nested as part of a function or block execution. - bool root_has_job_control{false}; - /// The IO chain associated with any block containing this job. /// For example, in `begin; foo ; end < file.txt` this would have the 'file.txt' IO. io_chain_t block_io{};