summaryrefslogtreecommitdiffstats
path: root/cmd-set-option.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-12-10 16:59:02 +0000
committerTiago Cunha <tcunha@gmx.com>2009-12-10 16:59:02 +0000
commitdcdd2fb09497d9b568077afd0248f1f5156389f6 (patch)
treea608c55a40d668c5838d6138dc1e273450e50d61 /cmd-set-option.c
parent328861e330f7dac0c4d2c0bdbb58f59d2f5b78aa (diff)
Sync OpenBSD patchset 585:
Add "server options" which are server-wide and not bound to a session or window. Set and displayed with "set -s" and "show -s". Currently the only option is "quiet" (like command-line -q, allowing it to be set from .tmux.conf), but others will come along.
Diffstat (limited to 'cmd-set-option.c')
-rw-r--r--cmd-set-option.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c
index 50efb4f2..1ded4d3c 100644
--- a/cmd-set-option.c
+++ b/cmd-set-option.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-set-option.c,v 1.89 2009-12-04 22:14:47 tcunha Exp $ */
+/* $Id: cmd-set-option.c,v 1.90 2009-12-10 16:59:02 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -48,8 +48,8 @@ void cmd_set_option_choice(struct cmd_ctx *,
const struct cmd_entry cmd_set_option_entry = {
"set-option", "set",
- "[-aguw] [-t target-session|target-window] option [value]",
- CMD_ARG12, "aguw",
+ "[-agsuw] [-t target-session|target-window] option [value]",
+ CMD_ARG12, "agsuw",
NULL,
cmd_target_parse,
cmd_set_option_exec,
@@ -73,6 +73,10 @@ const char *set_option_bell_action_list[] = {
"none", "any", "current", NULL
};
+const struct set_option_entry set_option_table[] = {
+ { "quiet", SET_OPTION_FLAG, 0, 0, NULL },
+};
+
const struct set_option_entry set_session_option_table[] = {
{ "base-index", SET_OPTION_NUMBER, 0, INT_MAX, NULL },
{ "bell-action", SET_OPTION_CHOICE, 0, 0, set_option_bell_action_list },
@@ -172,7 +176,10 @@ cmd_set_option_exec(struct cmd *self, struct cmd_ctx *ctx)
u_int i;
int try_again;
- if (cmd_check_flag(data->chflags, 'w')) {
+ if (cmd_check_flag(data->chflags, 's')) {
+ oo = &global_options;
+ table = set_option_table;
+ } else if (cmd_check_flag(data->chflags, 'w')) {
table = set_window_option_table;
if (cmd_check_flag(data->chflags, 'g'))
oo = &global_w_options;