From bded7437064c76dd6cf4e76e558d826859adcc79 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 20 Apr 2015 15:34:56 +0000 Subject: 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. --- format.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'format.c') 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); -- cgit