mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 21:37:34 +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:
parent
0c6ce063e6
commit
8dd0c391e9
1 changed files with 3 additions and 0 deletions
|
@ -349,6 +349,9 @@ int Shell::builtin_fg(int argc, const char** argv)
|
||||||
dbg() << "Resuming " << job->pid() << " (" << job->cmd() << ")";
|
dbg() << "Resuming " << job->pid() << " (" << job->cmd() << ")";
|
||||||
fprintf(stderr, "Resuming job %" PRIu64 " - %s\n", job->job_id(), job->cmd().characters());
|
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) {
|
if (killpg(job->pgid(), SIGCONT) < 0) {
|
||||||
perror("killpg");
|
perror("killpg");
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue