version 1.96, 2015/12/12 18:32:24 |
version 1.97, 2015/12/16 21:50:37 |
|
|
} |
} |
|
|
void |
void |
server_destroy_pane(struct window_pane *wp) |
server_destroy_pane(struct window_pane *wp, int hooks) |
{ |
{ |
struct window *w = wp->window; |
struct window *w = wp->window; |
int old_fd; |
int old_fd; |
struct screen_write_ctx ctx; |
struct screen_write_ctx ctx; |
struct grid_cell gc; |
struct grid_cell gc; |
|
struct cmd_find_state fs; |
|
|
old_fd = wp->fd; |
old_fd = wp->fd; |
if (wp->fd != -1) { |
if (wp->fd != -1) { |
|
|
screen_write_puts(&ctx, &gc, "Pane is dead"); |
screen_write_puts(&ctx, &gc, "Pane is dead"); |
screen_write_stop(&ctx); |
screen_write_stop(&ctx); |
wp->flags |= PANE_REDRAW; |
wp->flags |= PANE_REDRAW; |
|
|
|
if (hooks && cmd_find_from_pane(&fs, wp) == 0) |
|
hooks_run(hooks_get(fs.s), NULL, &fs, "pane-died"); |
return; |
return; |
} |
} |
|
|
server_unzoom_window(w); |
server_unzoom_window(w); |
layout_close_pane(wp); |
layout_close_pane(wp); |
window_remove_pane(w, wp); |
window_remove_pane(w, wp); |
|
|
|
if (hooks && cmd_find_from_window(&fs, w) == 0) |
|
hooks_run(hooks_get(fs.s), NULL, &fs, "pane-exited"); |
|
|
if (TAILQ_EMPTY(&w->panes)) |
if (TAILQ_EMPTY(&w->panes)) |
server_kill_window(w); |
server_kill_window(w); |