mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-19 09:52:06 +02:00
Move some common and untidy code for window link/unlink into generic functions
instead of duplicating it in move/link window..
This commit is contained in:
@@ -55,17 +55,7 @@ cmd_unlink_window_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
destroyed = session_detach(s, wl);
|
||||
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
|
||||
c = ARRAY_ITEM(&clients, i);
|
||||
if (c == NULL || c->session != s)
|
||||
continue;
|
||||
if (destroyed) {
|
||||
c->session = NULL;
|
||||
server_write_client(c, MSG_EXIT, NULL, 0);
|
||||
} else
|
||||
server_redraw_client(c);
|
||||
}
|
||||
server_unlink_window(s, wl);
|
||||
recalculate_sizes();
|
||||
|
||||
return (0);
|
||||
|
Reference in New Issue
Block a user