diff --git a/tmate-decoder.c b/tmate-decoder.c index 09c7a9a0..ae176134 100644 --- a/tmate-decoder.c +++ b/tmate-decoder.c @@ -152,8 +152,10 @@ static void tmate_sync_window_panes(struct window *w, } TAILQ_FOREACH_SAFE(wp, &w->panes, entry, wp_tmp) { - if (wp->flags & PANE_KILL) + if (wp->flags & PANE_KILL) { + layout_close_pane(wp); window_remove_pane(w, wp); + } } active_pane_id = unpack_int(w_uk); diff --git a/tmate-slave.c b/tmate-slave.c index c77d5985..43c00169 100644 --- a/tmate-slave.c +++ b/tmate-slave.c @@ -336,8 +336,10 @@ static void tmate_spawn_slave_server(struct tmate_ssh_client *client) * We won't have access to it once in the jail. */ setup_ncurse(STDOUT_FILENO, "screen-256color"); - close_fds_except((int[]){tmux_socket_fd, ssh_get_fd(client->session), - fileno(log_file)}, 7); + + close_fds_except((int[]){tmux_socket_fd, + ssh_get_fd(client->session), + fileno(log_file)}, 3); #ifdef TMATE_RECORD_REPLAY tmate_session_log_fd = open("session-log.log",