summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tmux.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-12-10 09:16:52 +0000
committernicm <nicm@openbsd.org>2009-12-10 09:16:52 +0000
commitf79ec1191f6de2754f302c57d6ed09f9c5e5a9c5 (patch)
tree22e0c1ae1a6964bf9997fc9b21d611e630e1d59d /usr.bin/tmux/tmux.c
parenttweak previous; (diff)
downloadwireguard-openbsd-f79ec1191f6de2754f302c57d6ed09f9c5e5a9c5.tar.xz
wireguard-openbsd-f79ec1191f6de2754f302c57d6ed09f9c5e5a9c5.zip
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 'usr.bin/tmux/tmux.c')
-rw-r--r--usr.bin/tmux/tmux.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/tmux/tmux.c b/usr.bin/tmux/tmux.c
index 15ad3379382..d9a6dc95192 100644
--- a/usr.bin/tmux/tmux.c
+++ b/usr.bin/tmux/tmux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.c,v 1.62 2009/12/03 22:50:10 nicm Exp $ */
+/* $OpenBSD: tmux.c,v 1.63 2009/12/10 09:16:52 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -36,12 +36,12 @@ extern char *malloc_options;
#endif
char *cfg_file;
+struct options global_options; /* server options */
struct options global_s_options; /* session options */
struct options global_w_options; /* window options */
struct environ global_environ;
int debug_level;
-int be_quiet;
time_t start_time;
char *socket_path;
int login_shell;
@@ -222,14 +222,14 @@ main(int argc, char **argv)
struct cmd *cmd;
enum msgtype msg;
struct passwd *pw;
- struct options *so, *wo;
+ struct options *oo, *so, *wo;
struct keylist *keylist;
struct msg_command_data cmddata;
char *s, *shellcmd, *path, *label, *home, *cause;
char cwd[MAXPATHLEN], **var;
void *buf;
size_t len;
- int opt, flags, cmdflags = 0;
+ int opt, flags, quiet, cmdflags = 0;
short events;
#ifdef DEBUG
@@ -268,7 +268,7 @@ main(int argc, char **argv)
label = xstrdup(optarg);
break;
case 'q':
- be_quiet = 1;
+ quiet = 1;
break;
case 'S':
if (path != NULL)
@@ -314,6 +314,10 @@ main(int argc, char **argv)
for (var = environ; *var != NULL; var++)
environ_put(&global_environ, *var);
+ options_init(&global_options, NULL);
+ oo = &global_options;
+ options_set_number(oo, "quiet", 0);
+
options_init(&global_s_options, NULL);
so = &global_s_options;
options_set_number(so, "base-index", 0);