aboutsummaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
authornicm <nicm>2020-05-16 15:24:28 +0000
committernicm <nicm>2020-05-16 15:24:28 +0000
commit78595457f965975cf5a24e8bbab6dcb153020b6e (patch)
tree622695a4a91e2d3fd490d8f0b9e79aa48ae9bedc /job.c
parenta3cbc014c386fd1f171e3139ed71c67503e1ccb3 (diff)
downloadrtmux-78595457f965975cf5a24e8bbab6dcb153020b6e.tar.gz
rtmux-78595457f965975cf5a24e8bbab6dcb153020b6e.tar.bz2
rtmux-78595457f965975cf5a24e8bbab6dcb153020b6e.zip
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 997a6574..efc0199e 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 <paths.h>
@@ -285,6 +286,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;