diff options
author | 2012-01-21 08:40:09 +0000 | |
---|---|---|
committer | 2012-01-21 08:40:09 +0000 | |
commit | f193b8ed5c0ec20345e0f1ce456ee30fb477038a (patch) | |
tree | 952a8f9ca3bacd4559133ef7bc6429712a0b4c29 /usr.bin/tmux/server-client.c | |
parent | Add strings to allow the aixterm bright colours to be used when (diff) | |
download | wireguard-openbsd-f193b8ed5c0ec20345e0f1ce456ee30fb477038a.tar.xz wireguard-openbsd-f193b8ed5c0ec20345e0f1ce456ee30fb477038a.zip |
Drop the ability to have a list of keys in the prefix in favour of two
separate options, prefix and prefix2. This simplifies the code and gets
rid the data options type which was only used for this one option.
Also add a -2 flag to send-prefix to send the secondary prefix key,
fixing a cause of minor irritation.
People who want three prefix keys are out of luck :-).
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r-- | usr.bin/tmux/server-client.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 6e18cb6a533..10b9f7386aa 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.62 2011/12/24 08:26:59 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.63 2012/01/21 08:40:09 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -273,9 +273,7 @@ server_client_handle_key(int key, struct mouse_event *mouse, void *data) struct options *oo; struct timeval tv; struct key_binding *bd; - struct keylist *keylist; int xtimeout, isprefix; - u_int i; /* Check the client is good to accept input. */ if ((c->flags & (CLIENT_DEAD|CLIENT_SUSPENDED)) != 0) @@ -360,14 +358,12 @@ server_client_handle_key(int key, struct mouse_event *mouse, void *data) } /* Is this a prefix key? */ - keylist = options_get_data(&c->session->options, "prefix"); - isprefix = 0; - for (i = 0; i < ARRAY_LENGTH(keylist); i++) { - if (key == ARRAY_ITEM(keylist, i)) { - isprefix = 1; - break; - } - } + if (key == options_get_number(&c->session->options, "prefix")) + isprefix = 1; + else if (key == options_get_number(&c->session->options, "prefix2")) + isprefix = 1; + else + isprefix = 0; /* No previous prefix key. */ if (!(c->flags & CLIENT_PREFIX)) { |