=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/server-fn.c,v retrieving revision 1.101 retrieving revision 1.102 diff -u -r1.101 -r1.102 --- src/usr.bin/tmux/server-fn.c 2016/10/11 13:21:59 1.101 +++ src/usr.bin/tmux/server-fn.c 2016/10/16 22:06:40 1.102 @@ -1,4 +1,4 @@ -/* $OpenBSD: server-fn.c,v 1.101 2016/10/11 13:21:59 nicm Exp $ */ +/* $OpenBSD: server-fn.c,v 1.102 2016/10/16 22:06:40 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -258,7 +258,8 @@ * Can't use session_detach as it will destroy session * if this makes it empty. */ - notify_window_unlinked(dst, dstwl->window); + notify_session_window("window-unlinked", dst, + dstwl->window); dstwl->flags &= ~WINLINK_ALERTFLAGS; winlink_stack_remove(&dst->lastw, dstwl); winlink_remove(&dst->windows, dstwl); @@ -294,13 +295,12 @@ } void -server_destroy_pane(struct window_pane *wp, int hooks) +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; - struct cmd_find_state fs; old_fd = wp->fd; if (wp->fd != -1) { @@ -312,6 +312,10 @@ if (options_get_number(w->options, "remain-on-exit")) { if (old_fd == -1) return; + + if (notify) + notify_pane("pane-died", wp); + 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); @@ -322,18 +326,16 @@ screen_write_stop(&ctx); wp->flags |= PANE_REDRAW; - if (hooks && cmd_find_from_pane(&fs, wp) == 0) - hooks_run(hooks_get(fs.s), NULL, &fs, "pane-died"); return; } + if (notify) + notify_pane("pane-exited", wp); + server_unzoom_window(w); layout_close_pane(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)) server_kill_window(w); else @@ -394,7 +396,7 @@ c->session = s_new; server_client_set_key_table(c, NULL); status_timer_start(c); - notify_attached_session_changed(c); + notify_client("client-session-changed", c); session_update_activity(s_new, NULL); gettimeofday(&s_new->last_attached_time, NULL); server_redraw_client(c);