mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-31 09:01:25 +08:00
Don't assign jobs to fish's pgrp if there's no external process
Fixes #6011
This commit is contained in:
parent
28a17c4b05
commit
73bf60754c
13
src/exec.cpp
13
src/exec.cpp
@ -1013,6 +1013,19 @@ static process_t *get_deferred_process(const shared_ptr<job_t> &j) {
|
||||
/// \return true if fish should claim the process group for this job.
|
||||
/// This is true if there is at least one external process and if the first process is fish code.
|
||||
static bool should_claim_process_group_for_job(const shared_ptr<job_t> &j) {
|
||||
// Check if there's an external process.
|
||||
// See #6011.
|
||||
bool has_external = false;
|
||||
for (const auto &p : j->processes) {
|
||||
if (p->type == process_type_t::external) {
|
||||
has_external = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!has_external) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check the first process.
|
||||
// The terminal owner has to be the process which is permitted to read from stdin.
|
||||
// This is the first process in the pipeline. When executing, a process in the job will
|
||||
|
Loading…
x
Reference in New Issue
Block a user