mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 03:08:46 +00:00
Sync OpenBSD patchset 1134:
Add -a for kill-session, from Thomas Adam.
This commit is contained in:
parent
4a634a7da4
commit
1c15848c47
@ -31,8 +31,8 @@ int cmd_kill_session_exec(struct cmd *, struct cmd_ctx *);
|
|||||||
|
|
||||||
const struct cmd_entry cmd_kill_session_entry = {
|
const struct cmd_entry cmd_kill_session_entry = {
|
||||||
"kill-session", NULL,
|
"kill-session", NULL,
|
||||||
"t:", 0, 0,
|
"at:", 0, 0,
|
||||||
CMD_TARGET_SESSION_USAGE,
|
"[-a] " CMD_TARGET_SESSION_USAGE,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
@ -43,13 +43,21 @@ int
|
|||||||
cmd_kill_session_exec(struct cmd *self, struct cmd_ctx *ctx)
|
cmd_kill_session_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||||
{
|
{
|
||||||
struct args *args = self->args;
|
struct args *args = self->args;
|
||||||
struct session *s;
|
struct session *s, *s2, *s3;
|
||||||
|
|
||||||
if ((s = cmd_find_session(ctx, args_get(args, 't'), 0)) == NULL)
|
if ((s = cmd_find_session(ctx, args_get(args, 't'), 0)) == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
server_destroy_session(s);
|
if (args_has(args, 'a')) {
|
||||||
session_destroy(s);
|
RB_FOREACH_SAFE(s2, sessions, &sessions, s3) {
|
||||||
|
if (s != s2) {
|
||||||
|
server_destroy_session(s2);
|
||||||
|
session_destroy(s2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
server_destroy_session(s);
|
||||||
|
session_destroy(s);
|
||||||
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
7
tmux.1
7
tmux.1
@ -614,9 +614,14 @@ If it does exist, exit with 0.
|
|||||||
Kill the
|
Kill the
|
||||||
.Nm
|
.Nm
|
||||||
server and clients and destroy all sessions.
|
server and clients and destroy all sessions.
|
||||||
.It Ic kill-session Op Fl t Ar target-session
|
.It Ic kill-session
|
||||||
|
.Op Fl a
|
||||||
|
.Op Fl t Ar target-session
|
||||||
Destroy the given session, closing any windows linked to it and no other
|
Destroy the given session, closing any windows linked to it and no other
|
||||||
sessions, and detaching all clients attached to it.
|
sessions, and detaching all clients attached to it.
|
||||||
|
If
|
||||||
|
.Fl a
|
||||||
|
is given, all sessions but the specified one is killed.
|
||||||
.It Xo Ic list-clients
|
.It Xo Ic list-clients
|
||||||
.Op Fl F Ar format
|
.Op Fl F Ar format
|
||||||
.Op Fl t Ar target-session
|
.Op Fl t Ar target-session
|
||||||
|
Loading…
Reference in New Issue
Block a user