diff options
author | nicm <nicm> | 2015-04-20 15:34:56 +0000 |
---|---|---|
committer | nicm <nicm> | 2015-04-20 15:34:56 +0000 |
commit | bded7437064c76dd6cf4e76e558d826859adcc79 (patch) | |
tree | 708c5dee6ddf671161b5ffa7208cba05e52eb4c5 /format.c | |
parent | 3497843f0272e573d0a63cb6e94948591ae07667 (diff) |
Support for multiple key tables to commands to be bound to sequences of
keys. The default key bindings become the "prefix" table and -n the
"root" table. Keys may be bound in new tables with bind -T and
switch-client -T used to specify the table in which the next key should
be looked up. Based on a diff from Keith Amling.
Diffstat (limited to 'format.c')
-rw-r--r-- | format.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -545,7 +545,11 @@ format_defaults_client(struct format_tree *ft, struct client *c) format_add(ft, "client_activity", "%lld", (long long) t); format_add(ft, "client_activity_string", "%s", format_time_string(t)); - format_add(ft, "client_prefix", "%d", !!(c->flags & CLIENT_PREFIX)); + if (strcmp(c->keytable->name, "root") == 0) + format_add(ft, "client_prefix", "%d", 0); + else + format_add(ft, "client_prefix", "%d", 1); + format_add(ft, "client_key_table", "%s", c->keytable->name); if (c->tty.flags & TTY_UTF8) format_add(ft, "client_utf8", "%d", 1); |