aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authornicm <nicm>2018-11-30 08:44:40 +0000
committernicm <nicm>2018-11-30 08:44:40 +0000
commit67254ed8df2434d7c974f66fbdbf3e4c58f61319 (patch)
treeb7990f917cad2d6deb6a789e4f578334d77d571a /window.c
parent40d246b29c8e0ee012d7836969dc8b41d6516444 (diff)
downloadrtmux-67254ed8df2434d7c974f66fbdbf3e4c58f61319.tar.gz
rtmux-67254ed8df2434d7c974f66fbdbf3e4c58f61319.tar.bz2
rtmux-67254ed8df2434d7c974f66fbdbf3e4c58f61319.zip
Clear PANE_EXITED flag when starting new child process in case the pane
has been respawned.
Diffstat (limited to 'window.c')
-rw-r--r--window.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/window.c b/window.c
index 530d9574..9a6c729c 100644
--- a/window.c
+++ b/window.c
@@ -921,6 +921,7 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv,
sigprocmask(SIG_BLOCK, &set, &oldset);
switch (wp->pid = fdforkpty(ptm_fd, &wp->fd, wp->tty, NULL, &ws)) {
case -1:
+ wp->event = NULL;
wp->fd = -1;
xasprintf(cause, "%s: %s", cmd, strerror(errno));
@@ -1000,6 +1001,9 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv,
if (wp->event == NULL)
fatalx("out of memory");
+ wp->pipe_off = 0;
+ wp->flags &= ~PANE_EXITED;
+
bufferevent_setwatermark(wp->event, EV_READ, 0, READ_SIZE);
bufferevent_enable(wp->event, EV_READ|EV_WRITE);