mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
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.
This commit is contained in:
5
format.c
5
format.c
@ -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
|
||||
|
Reference in New Issue
Block a user