diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2013-03-21 16:14:09 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2013-03-21 16:14:09 +0000 |
commit | 63b4fd5cacc1a53b93e92ef007d5a7249f5cac38 (patch) | |
tree | efe04a456d3a8cda3f84611174e33caf0f74a9cf /format.c | |
parent | dd76497ab01620bf5c7b63205f3e1405f3c34d8c (diff) |
Add a format client_prefix which is 1 if prefix key has been
pressed, used for example #{?client_prefix,X,Y}. Also a few extra
server_client_status needed.
Diffstat (limited to 'format.c')
-rw-r--r-- | format.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -251,10 +251,11 @@ format_expand(struct format_tree *ft, const char *fmt) continue; } } - while (len - off < 2) { + while (len - off < 3) { buf = xrealloc(buf, 2, len); len *= 2; } + buf[off++] = '#'; buf[off++] = ch; continue; } @@ -321,6 +322,8 @@ format_client(struct format_tree *ft, struct client *c) *strchr(tim, '\n') = '\0'; format_add(ft, "client_activity_string", "%s", tim); + format_add(ft, "client_prefix", "%d", !!(c->flags & CLIENT_PREFIX)); + if (c->tty.flags & TTY_UTF8) format_add(ft, "client_utf8", "%d", 1); else |