1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:48:11 +00:00

Shell: Make "fg" set the TTY PGID before SIGCONT'ing the job

Otherwise the child will get SIGTTIN/SIGTTOU on next TTY I/O.
This commit is contained in:
Andreas Kling 2020-08-06 15:50:57 +02:00
parent 0c6ce063e6
commit 8dd0c391e9

View file

@ -349,6 +349,9 @@ int Shell::builtin_fg(int argc, const char** argv)
dbg() << "Resuming " << job->pid() << " (" << job->cmd() << ")";
fprintf(stderr, "Resuming job %" PRIu64 " - %s\n", job->job_id(), job->cmd().characters());
tcsetpgrp(STDOUT_FILENO, job->pgid());
tcsetpgrp(STDIN_FILENO, job->pgid());
if (killpg(job->pgid(), SIGCONT) < 0) {
perror("killpg");
return 1;