diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-07-24 14:52:47 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-07-24 14:52:47 +0000 |
commit | 5a1a1066371328f9d53a9bc5e5c4c53acb26c2b2 (patch) | |
tree | b9b54a76352420ff03b31146ad0846e438332949 /server.c | |
parent | ce4eb6559e1aabb67e08a367a7c5e049e800c7ed (diff) |
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 'server.c')
-rw-r--r-- | server.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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; |