summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tmux.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-09-22 12:38:11 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-09-22 12:38:11 +0000
commit1f7e7007af7bfef7a9dc88c2a09832a90603076f (patch)
tree1aacba34d320ef343052c32237caa928513afd82 /usr.bin/tmux/tmux.c
parent849dd7297d7a8729f4fc89b9322ebaad270aa091 (diff)
Permit multiple prefix keys to be defined, separated by commas, for example:
set -g prefix ^a,^b Any key in the list acts as the prefix. The send-prefix command always sends the first key in the list.
Diffstat (limited to 'usr.bin/tmux/tmux.c')
-rw-r--r--usr.bin/tmux/tmux.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/tmux/tmux.c b/usr.bin/tmux/tmux.c
index c42d8c8cc8b..f940b7d68b3 100644
--- a/usr.bin/tmux/tmux.c
+++ b/usr.bin/tmux/tmux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.c,v 1.43 2009/09/18 15:19:27 nicm Exp $ */
+/* $OpenBSD: tmux.c,v 1.44 2009/09/22 12:38:10 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -309,6 +309,7 @@ main(int argc, char **argv)
enum msgtype msg;
struct passwd *pw;
struct options *so, *wo;
+ struct keylist *keylist;
char *s, *path, *label, *home, *cause, **var;
char cwd[MAXPATHLEN];
void *buf;
@@ -409,7 +410,6 @@ main(int argc, char **argv)
options_set_number(so, "message-attr", 0);
options_set_number(so, "message-bg", 3);
options_set_number(so, "message-fg", 0);
- options_set_number(so, "prefix", '\002');
options_set_number(so, "repeat-time", 500);
options_set_number(so, "set-remain-on-exit", 0);
options_set_number(so, "set-titles", 0);
@@ -439,6 +439,11 @@ main(int argc, char **argv)
options_set_number(so, "visual-bell", 0);
options_set_number(so, "visual-content", 0);
+ keylist = xmalloc(sizeof *keylist);
+ ARRAY_INIT(keylist);
+ ARRAY_ADD(keylist, '\002');
+ options_set_data(so, "prefix", keylist, xfree);
+
options_init(&global_w_options, NULL);
wo = &global_w_options;
options_set_number(wo, "aggressive-resize", 0);