mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
Merge branch 'obsd-master'
This commit is contained in:
20
server-fn.c
20
server-fn.c
@ -256,7 +256,8 @@ server_link_window(struct session *src, struct winlink *srcwl,
|
||||
* 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);
|
||||
@ -292,13 +293,12 @@ server_unlink_window(struct session *s, struct winlink *wl)
|
||||
}
|
||||
|
||||
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) {
|
||||
@ -313,6 +313,10 @@ server_destroy_pane(struct window_pane *wp, int hooks)
|
||||
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);
|
||||
@ -323,18 +327,16 @@ server_destroy_pane(struct window_pane *wp, int hooks)
|
||||
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
|
||||
@ -395,7 +397,7 @@ server_destroy_session(struct session *s)
|
||||
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);
|
||||
|
Reference in New Issue
Block a user