mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-28 13:11:15 -03:00
Teach a job to decide its job tree
Job trees come in two flavors: “placeholders” for jobs which are only fish functions, and non-placeholders which need to track a pgid. This adds logic to allow a job to decide if its parent's job tree is appropriate, and allocating a new tree if not.
This commit is contained in:
@@ -1283,8 +1283,9 @@ end_execution_reason_t parse_execution_context_t::run_1_job(tnode_t<g::job> job_
|
||||
|
||||
// Clean up the job on failure or cancellation.
|
||||
if (pop_result == end_execution_reason_t::ok) {
|
||||
// Set the pgroup assignment mode, now that the job is populated.
|
||||
// Set the pgroup assignment mode and job tree, now that the job is populated.
|
||||
job->pgroup_provenance = get_pgroup_provenance(job, lineage);
|
||||
job->job_tree = job_tree_t::decide_tree_for_job(job.get(), lineage.job_tree);
|
||||
|
||||
// Success. Give the job to the parser - it will clean it up.
|
||||
parser->job_add(job);
|
||||
|
||||
Reference in New Issue
Block a user