mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 11:18:48 +00:00
Sync OpenBSD patchset 957:
Mark dead panes with some text saying they are dead, suggested by and with help from Randy Stauner.
This commit is contained in:
parent
d9807eeba1
commit
6e0c097d9f
18
server-fn.c
18
server-fn.c
@ -330,15 +330,31 @@ void
|
|||||||
server_destroy_pane(struct window_pane *wp)
|
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) {
|
if (wp->fd != -1) {
|
||||||
close(wp->fd);
|
close(wp->fd);
|
||||||
bufferevent_free(wp->event);
|
bufferevent_free(wp->event);
|
||||||
wp->fd = -1;
|
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;
|
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);
|
layout_close_pane(wp);
|
||||||
window_remove_pane(w, wp);
|
window_remove_pane(w, wp);
|
||||||
|
Loading…
Reference in New Issue
Block a user