summaryrefslogtreecommitdiffstats
path: root/job.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2020-05-01 09:02:44 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2020-05-01 09:02:44 +0100
commitcc19203be2aab1adc4930b18e46d522005159412 (patch)
tree15d50f1af3bfa4017c47184c31aa6900e781c062 /job.c
parent7af58172457f74c6bb8e09625a07b2ddfeea2b8a (diff)
Add 'e' key in buffer mode to open the buffer in an editor.
Diffstat (limited to 'job.c')
-rw-r--r--job.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/job.c b/job.c
index 607f7138..6c1a3e09 100644
--- a/job.c
+++ b/job.c
@@ -19,6 +19,7 @@
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
+#include <sys/wait.h>
#include <fcntl.h>
#include <signal.h>
@@ -283,6 +284,12 @@ job_check_died(pid_t pid, int status)
}
if (job == NULL)
return;
+ if (WIFSTOPPED(status)) {
+ if (WSTOPSIG(status) == SIGTTIN || WSTOPSIG(status) == SIGTTOU)
+ return;
+ killpg(job->pid, SIGCONT);
+ return;
+ }
log_debug("job died %p: %s, pid %ld", job, job->cmd, (long) job->pid);
job->status = status;