mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 00:01:15 -03:00
builtins to only acquire terminal if owned by their pgroup
Fix #5133 changed builtins to acquire the terminal, but this regressed caused fish to be stopped when running in background via `sudo fish`. Fix this by only acquiring the terminal if the terminal was owned by the builtin's pgroup. Fixes #5147
This commit is contained in:
@@ -484,7 +484,7 @@ static bool exec_internal_builtin_proc(parser_t &parser, job_t *j, process_t *p,
|
||||
j->set_flag(JOB_FOREGROUND, false);
|
||||
|
||||
// Note this call may block for a long time, while the builtin performs I/O.
|
||||
p->status = builtin_run(parser, p->get_argv(), streams);
|
||||
p->status = builtin_run(parser, j->pgid, p->get_argv(), streams);
|
||||
|
||||
// Restore the fg flag, which is temporarily set to false during builtin
|
||||
// execution so as not to confuse some job-handling builtins.
|
||||
|
||||
Reference in New Issue
Block a user