diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-07-25 08:52:04 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-07-25 08:52:04 +0000 |
commit | 28cf7dc39ed54a49567204c951ada1681af44734 (patch) | |
tree | 2c259016303d7dd0b82089ed64de7f89cd78f8f2 /server.c | |
parent | 744ccb7cc933c6e433a3b4a4c889364540689829 (diff) |
Sync OpenBSD patchset 175:
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 | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.162 2009-07-22 17:46:53 tcunha Exp $ */ +/* $Id: server.c,v 1.163 2009-07-25 08:52:04 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -807,14 +807,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; |