mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-11 22:49:04 +02:00
Add a -k flag to unlink-window which makes it behave the same as the old
kill-window - if a window is linked into only one session it unlinked and destroyed.
This commit is contained in:
@ -28,8 +28,8 @@ int cmd_unlink_window_exec(struct cmd *, struct cmd_ctx *);
|
||||
|
||||
const struct cmd_entry cmd_unlink_window_entry = {
|
||||
"unlink-window", "unlinkw",
|
||||
CMD_TARGET_WINDOW_USAGE,
|
||||
0, 0,
|
||||
"[-k] " CMD_TARGET_WINDOW_USAGE,
|
||||
0, CMD_CHFLAG('k'),
|
||||
cmd_target_init,
|
||||
cmd_target_parse,
|
||||
cmd_unlink_window_exec,
|
||||
@ -52,7 +52,7 @@ cmd_unlink_window_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
if ((wl = cmd_find_window(ctx, data->target, &s)) == NULL)
|
||||
return (-1);
|
||||
|
||||
if (wl->window->references == 1) {
|
||||
if (!(data->chflags & CMD_CHFLAG('k')) && wl->window->references == 1) {
|
||||
ctx->error(ctx, "window is only linked to one session");
|
||||
return (-1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user