summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2018-11-30 08:44:41 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2018-11-30 08:44:41 +0000
commit8afcda0c5604153d1c697caea6dc247f65b42470 (patch)
treeed2284ccaaaa0808ed84183e9d9a351087f280dd /usr.bin/tmux/window.c
parenta886d8130b49576f526bac6f934e82dbf953882d (diff)
Clear PANE_EXITED flag when starting new child process in case the pane
has been respawned.
Diffstat (limited to 'usr.bin/tmux/window.c')
-rw-r--r--usr.bin/tmux/window.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c
index a0ba831f299..eac84bdf3f9 100644
--- a/usr.bin/tmux/window.c
+++ b/usr.bin/tmux/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.214 2018/11/19 13:35:41 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.215 2018/11/30 08:44:40 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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);