diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2011-09-05 23:40:52 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2011-09-05 23:40:52 +0000 |
commit | 3368f86d7145ae4fd55fdaf3cb227fbe6b122657 (patch) | |
tree | 8cabfed03c72ee07c76996b00ed66ead583232de /usr.bin/tmux/server-fn.c | |
parent | 365a9d93af66515d1bf1f7f107ce9a090cf1029c (diff) |
Mark dead panes with some text saying they are dead, suggested by and
with help from Randy Stauner.
Diffstat (limited to 'usr.bin/tmux/server-fn.c')
-rw-r--r-- | usr.bin/tmux/server-fn.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/usr.bin/tmux/server-fn.c b/usr.bin/tmux/server-fn.c index dde93cac0f0..85cc7b88486 100644 --- a/usr.bin/tmux/server-fn.c +++ b/usr.bin/tmux/server-fn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-fn.c,v 1.50 2011/01/23 11:03:43 nicm Exp $ */ +/* $OpenBSD: server-fn.c,v 1.51 2011/09/05 23:40:51 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -329,16 +329,32 @@ server_unlink_window(struct session *s, struct winlink *wl) void server_destroy_pane(struct window_pane *wp) { - struct window *w = wp->window; + 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) { close(wp->fd); bufferevent_free(wp->event); wp->fd = -1; } - if (options_get_number(&w->options, "remain-on-exit")) + if (options_get_number(&w->options, "remain-on-exit")) { + if (old_fd == -1) + return; + screen_write_start(&ctx, wp, &wp->base); + screen_write_scrollregion(&ctx, 0, screen_size_y(ctx.s) - 1); + screen_write_cursormove(&ctx, 0, screen_size_y(ctx.s) - 1); + screen_write_linefeed(&ctx, 1); + 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; + } layout_close_pane(wp); window_remove_pane(w, wp); |