summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/options-table.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-02-01 08:01:15 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-02-01 08:01:15 +0000
commita3ed5bd99f310d7083083da6f32b73a729062bc2 (patch)
tree07933344df182b94995485e4c73dc1907b855e20 /usr.bin/tmux/options-table.c
parent520cfa7e3093d7f9aa74f4f3d05c15e4fc83132a (diff)
Add a no-detached choice to detach-on-destroy which detaches only if
there are no other detached sessions to switch to, from Sencer Selcuk in GitHub issue 2553.
Diffstat (limited to 'usr.bin/tmux/options-table.c')
-rw-r--r--usr.bin/tmux/options-table.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/tmux/options-table.c b/usr.bin/tmux/options-table.c
index 18ba826c91d..eac3cb5d5c2 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.138 2021/01/20 07:16:54 nicm Exp $ */
+/* $OpenBSD: options-table.c,v 1.139 2021/02/01 08:01:14 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -72,6 +72,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_detach_on_destroy_list[] = {
+ "off", "on", "no-detached", NULL
+};
/* Status line format. */
#define OPTIONS_TABLE_STATUS_FORMAT1 \
@@ -405,8 +408,9 @@ const struct options_table_entry options_table[] = {
},
{ .name = "detach-on-destroy",
- .type = OPTIONS_TABLE_FLAG,
+ .type = OPTIONS_TABLE_CHOICE,
.scope = OPTIONS_TABLE_SESSION,
+ .choices = options_table_detach_on_destroy_list,
.default_num = 1,
.text = "Whether to detach when a session is destroyed, or switch "
"the client to another session if any exist."