Clear PANE_EXITED flag when starting new child process in case the pane

has been respawned.
This commit is contained in:
nicm
2018-11-30 08:44:40 +00:00
parent 40d246b29c
commit 67254ed8df
3 changed files with 9 additions and 1 deletions

View File

@ -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);