=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/server-fn.c,v retrieving revision 1.111 retrieving revision 1.112 diff -c -r1.111 -r1.112 *** src/usr.bin/tmux/server-fn.c 2017/08/29 09:18:48 1.111 --- src/usr.bin/tmux/server-fn.c 2017/10/12 11:32:27 1.112 *************** *** 1,4 **** ! /* $OpenBSD: server-fn.c,v 1.111 2017/08/29 09:18:48 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: server-fn.c,v 1.112 2017/10/12 11:32:27 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 18,23 **** --- 18,24 ---- #include #include + #include #include #include *************** *** 278,288 **** server_destroy_pane(struct window_pane *wp, int notify) { struct window *w = wp->window; - int old_fd; struct screen_write_ctx ctx; struct grid_cell gc; - old_fd = wp->fd; if (wp->fd != -1) { bufferevent_free(wp->event); close(wp->fd); --- 279,289 ---- server_destroy_pane(struct window_pane *wp, int notify) { struct window *w = wp->window; struct screen_write_ctx ctx; struct grid_cell gc; + time_t t; + char tim[26]; if (wp->fd != -1) { bufferevent_free(wp->event); close(wp->fd); *************** *** 290,298 **** } if (options_get_number(w->options, "remain-on-exit")) { ! if (old_fd == -1) return; if (notify) notify_pane("pane-died", wp); --- 291,303 ---- } if (options_get_number(w->options, "remain-on-exit")) { ! if (~wp->flags & PANE_STATUSREADY) return; + if (wp->flags & PANE_STATUSDRAWN) + return; + wp->flags |= PANE_STATUSDRAWN; + if (notify) notify_pane("pane-died", wp); *************** *** 301,311 **** screen_write_cursormove(&ctx, 0, screen_size_y(ctx.s) - 1); screen_write_linefeed(&ctx, 1, 8); memcpy(&gc, &grid_default_cell, sizeof gc); ! gc.attr |= GRID_ATTR_BRIGHT; ! screen_write_puts(&ctx, &gc, "Pane is dead"); screen_write_stop(&ctx); wp->flags |= PANE_REDRAW; - return; } --- 306,329 ---- screen_write_cursormove(&ctx, 0, screen_size_y(ctx.s) - 1); screen_write_linefeed(&ctx, 1, 8); memcpy(&gc, &grid_default_cell, sizeof gc); ! ! time(&t); ! ctime_r(&t, tim); ! ! if (WIFEXITED(wp->status)) { ! screen_write_nputs(&ctx, -1, &gc, ! "Pane is dead (status %d, %s)", ! WEXITSTATUS(wp->status), ! tim); ! } else if (WIFSIGNALED(wp->status)) { ! screen_write_nputs(&ctx, -1, &gc, ! "Pane is dead (signal %d, %s)", ! WTERMSIG(wp->status), ! tim); ! } ! screen_write_stop(&ctx); wp->flags |= PANE_REDRAW; return; }