diff options
Diffstat (limited to 'src/ground.cc')
| -rw-r--r-- | src/ground.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ground.cc b/src/ground.cc index 54a333f..265a22d 100644 --- a/src/ground.cc +++ b/src/ground.cc @@ -5,6 +5,9 @@ using namespace std; namespace ov4 { +pid_t shell_pgid; +int tty_fd; + /* * waitfg - Block until process pid is no longer the foreground process */ @@ -17,6 +20,11 @@ void waitfg(pid_t pid) LOG << "waiting for pid "<< fgpid(jobs) << endl; while (fgpid(jobs) != 0) sigsuspend(&prev_with_sigchld_unblocked); + + // set shell to foreground again + tcsetpgrp(tty_fd, shell_pgid); + sigprocmask(SIG_BLOCK, &block_io, nullptr); + LOG << "finished fg " << endl; return; } |
