summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/options-table.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2024-02-13 08:10:24 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2024-02-13 08:10:24 +0000
commit573ae1b51658417be60a4b0f6e694d6a6e1f2a6d (patch)
tree5a2552f786b8b8d8de296eb5aa29f92195078061 /usr.bin/tmux/options-table.c
parent38fe5c8fbbdaecfda6e4f0c0092cd54438202801 (diff)
Add two new values for the destroy-unattached option to destroy sessions
only if they are not members of sessions groups, from Mark Huang, GitHub issue 3806.
Diffstat (limited to 'usr.bin/tmux/options-table.c')
-rw-r--r--usr.bin/tmux/options-table.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/tmux/options-table.c b/usr.bin/tmux/options-table.c
index 7f51a0a69db..3dbc1b8479b 100644
--- a/usr.bin/tmux/options-table.c
+++ b/usr.bin/tmux/options-table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options-table.c,v 1.168 2023/09/01 13:48:54 nicm Exp $ */
+/* $OpenBSD: options-table.c,v 1.169 2024/02/13 08:10:23 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -85,6 +85,9 @@ static const char *options_table_window_size_list[] = {
static const char *options_table_remain_on_exit_list[] = {
"off", "on", "failed", NULL
};
+static const char *options_table_destroy_unattached_list[] = {
+ "off", "on", "keep-last", "keep-group", NULL
+};
static const char *options_table_detach_on_destroy_list[] = {
"off", "on", "no-detached", "previous", "next", NULL
};
@@ -484,11 +487,12 @@ const struct options_table_entry options_table[] = {
},
{ .name = "destroy-unattached",
- .type = OPTIONS_TABLE_FLAG,
+ .type = OPTIONS_TABLE_CHOICE,
.scope = OPTIONS_TABLE_SESSION,
+ .choices = options_table_destroy_unattached_list,
.default_num = 0,
.text = "Whether to destroy sessions when they have no attached "
- "clients."
+ "clients, or keep the last session whether in the group."
},
{ .name = "detach-on-destroy",