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.
This commit is contained in:
ridiculousfish 2020-02-08 14:40:06 -08:00
parent e95bcfb074
commit fe60f2ef16
3 changed files with 1 additions and 6 deletions

View File

@ -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;

View File

@ -1251,7 +1251,7 @@ end_execution_reason_t parse_execution_context_t::run_1_job(tnode_t<g::job> 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;

View File

@ -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{};