mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-20 14:11:14 -03:00
Migrate job pgid from job to job tree
Prior to this, jobs all had a pgid, and fish has to work hard to ensure that pgids were inherited properly for nested jobs. But now the job tree is the source of truth and there is only one location for the pgid.
This commit is contained in:
@@ -613,18 +613,10 @@ const job_t *parser_t::job_get(job_id_t id) const {
|
||||
}
|
||||
|
||||
job_t *parser_t::job_get_from_pid(pid_t pid) const {
|
||||
pid_t pgid = getpgid(pid);
|
||||
|
||||
if (pgid == -1) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (const auto &job : jobs()) {
|
||||
if (job->pgid == pgid) {
|
||||
for (const process_ptr_t &p : job->processes) {
|
||||
if (p->pid == pid) {
|
||||
return job.get();
|
||||
}
|
||||
for (const process_ptr_t &p : job->processes) {
|
||||
if (p->pid == pid) {
|
||||
return job.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user