summaryrefslogtreecommitdiffstats
path: root/format.c
diff options
context:
space:
mode:
authornicm <nicm>2015-04-20 15:34:56 +0000
committernicm <nicm>2015-04-20 15:34:56 +0000
commitbded7437064c76dd6cf4e76e558d826859adcc79 (patch)
tree708c5dee6ddf671161b5ffa7208cba05e52eb4c5 /format.c
parent3497843f0272e573d0a63cb6e94948591ae07667 (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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/format.c b/format.c
index cf1713ba..eb4664d1 100644
--- a/format.c
+++ b/format.c
@@ -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);