mirror of
https://github.com/tmux/tmux.git
synced 2024-11-16 01:18:52 +00:00
Use server_destroy_session() for kill-session.
This commit is contained in:
parent
42e2413978
commit
34464da8d3
@ -45,21 +45,11 @@ cmd_kill_session_exec(struct cmd *self, struct cmd_ctx *ctx)
|
|||||||
{
|
{
|
||||||
struct cmd_target_data *data = self->data;
|
struct cmd_target_data *data = self->data;
|
||||||
struct session *s;
|
struct session *s;
|
||||||
struct client *c;
|
|
||||||
u_int i;
|
|
||||||
|
|
||||||
if ((s = cmd_find_session(ctx, data->target)) == NULL)
|
if ((s = cmd_find_session(ctx, data->target)) == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
|
server_destroy_session(s);
|
||||||
c = ARRAY_ITEM(&clients, i);
|
|
||||||
if (c != NULL && c->session == s) {
|
|
||||||
c->session = NULL;
|
|
||||||
server_write_client(c, MSG_EXIT, NULL, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
recalculate_sizes();
|
|
||||||
|
|
||||||
session_destroy(s);
|
session_destroy(s);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -371,6 +371,7 @@ server_destroy_session(struct session *s)
|
|||||||
c->session = NULL;
|
c->session = NULL;
|
||||||
server_write_client(c, MSG_EXIT, NULL, 0);
|
server_write_client(c, MSG_EXIT, NULL, 0);
|
||||||
}
|
}
|
||||||
|
recalculate_sizes();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user