summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/server.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-07-24 14:52:47 +0000
committernicm <nicm@openbsd.org>2009-07-24 14:52:47 +0000
commitad4696b537fd88242e90e5414f9cde4552fab706 (patch)
tree407eedf23c7119d1f557a9ba9fa4a5617e3e44d5 /usr.bin/tmux/server.c
parentup-pane and down-pane no longer auto-repeat; update the description of (diff)
downloadwireguard-openbsd-ad4696b537fd88242e90e5414f9cde4552fab706.tar.xz
wireguard-openbsd-ad4696b537fd88242e90e5414f9cde4552fab706.zip
Permit commands to be bound to key presses without the prefix key first. The
new -n flag to bind-key and unbind-key sets or removes these bindings, and list-key shows them in []s.
Diffstat (limited to 'usr.bin/tmux/server.c')
-rw-r--r--usr.bin/tmux/server.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c
index 8b0b8a1ed3c..90981597fd7 100644
--- a/usr.bin/tmux/server.c
+++ b/usr.bin/tmux/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.13 2009/07/21 19:54:22 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.14 2009/07/24 14:52:47 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -802,14 +802,19 @@ server_handle_client(struct client *c)
if (!(c->flags & CLIENT_PREFIX)) {
if (key == prefix)
c->flags |= CLIENT_PREFIX;
- else
- window_pane_key(wp, c, key);
+ else {
+ /* Try as a non-prefix key binding. */
+ if ((bd = key_bindings_lookup(key)) == NULL)
+ window_pane_key(wp, c, key);
+ else
+ key_bindings_dispatch(bd, c);
+ }
continue;
}
/* Prefix key already pressed. Reset prefix and lookup key. */
c->flags &= ~CLIENT_PREFIX;
- if ((bd = key_bindings_lookup(key)) == NULL) {
+ if ((bd = key_bindings_lookup(key | KEYC_PREFIX)) == NULL) {
/* If repeating, treat this as a key, else ignore. */
if (c->flags & CLIENT_REPEAT) {
c->flags &= ~CLIENT_REPEAT;