mirror of
https://github.com/tmate-io/tmate.git
synced 2024-12-24 15:48:58 +01:00
Add -a flag to kill-window, from Thomas Adam.
This commit is contained in:
parent
5cbca2e70f
commit
ed58b2d353
@ -28,8 +28,8 @@ int cmd_kill_window_exec(struct cmd *, struct cmd_ctx *);
|
|||||||
|
|
||||||
const struct cmd_entry cmd_kill_window_entry = {
|
const struct cmd_entry cmd_kill_window_entry = {
|
||||||
"kill-window", "killw",
|
"kill-window", "killw",
|
||||||
"t:", 0, 0,
|
"at:", 0, 0,
|
||||||
CMD_TARGET_WINDOW_USAGE,
|
"[-a] " CMD_TARGET_WINDOW_USAGE,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
@ -40,13 +40,19 @@ int
|
|||||||
cmd_kill_window_exec(struct cmd *self, struct cmd_ctx *ctx)
|
cmd_kill_window_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||||
{
|
{
|
||||||
struct args *args = self->args;
|
struct args *args = self->args;
|
||||||
struct winlink *wl;
|
struct winlink *wl, *wl2;
|
||||||
|
|
||||||
if ((wl = cmd_find_window(ctx, args_get(args, 't'), NULL)) == NULL)
|
if ((wl = cmd_find_window(ctx, args_get(args, 't'), NULL)) == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
server_kill_window(wl->window);
|
if (args_has(args, 'a')) {
|
||||||
recalculate_sizes();
|
RB_FOREACH(wl2, winlinks, &ctx->curclient->session->windows) {
|
||||||
|
if (wl != wl2)
|
||||||
|
server_kill_window(wl2->window);
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
server_kill_window(wl->window);
|
||||||
|
|
||||||
|
recalculate_sizes();
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
9
tmux.1
9
tmux.1
@ -1157,11 +1157,18 @@ The
|
|||||||
.Fl a
|
.Fl a
|
||||||
option kills all but the pane given with
|
option kills all but the pane given with
|
||||||
.Fl t .
|
.Fl t .
|
||||||
.It Ic kill-window Op Fl t Ar target-window
|
.It Xo Ic kill-window
|
||||||
|
.Op Fl a
|
||||||
|
.Op Fl t Ar target-window
|
||||||
|
.Xc
|
||||||
.D1 (alias: Ic killw )
|
.D1 (alias: Ic killw )
|
||||||
Kill the current window or the window at
|
Kill the current window or the window at
|
||||||
.Ar target-window ,
|
.Ar target-window ,
|
||||||
removing it from any sessions to which it is linked.
|
removing it from any sessions to which it is linked.
|
||||||
|
The
|
||||||
|
.Fl a
|
||||||
|
option kills all but the window given with
|
||||||
|
.Fl t .
|
||||||
.It Ic last-pane Op Fl t Ar target-window
|
.It Ic last-pane Op Fl t Ar target-window
|
||||||
.D1 (alias: Ic lastp )
|
.D1 (alias: Ic lastp )
|
||||||
Select the last (previously selected) pane.
|
Select the last (previously selected) pane.
|
||||||
|
Loading…
Reference in New Issue
Block a user