summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/server-client.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2013-03-21 16:14:09 +0000
committernicm <nicm@openbsd.org>2013-03-21 16:14:09 +0000
commit28ffa703322bbc6cf91153744407493f66b8fdda (patch)
tree48dd814ab6e286a686f9d478fd0cb0591443c38a /usr.bin/tmux/server-client.c
parentAllow formats in status options. (diff)
downloadwireguard-openbsd-28ffa703322bbc6cf91153744407493f66b8fdda.tar.xz
wireguard-openbsd-28ffa703322bbc6cf91153744407493f66b8fdda.zip
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 'usr.bin/tmux/server-client.c')
-rw-r--r--usr.bin/tmux/server-client.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index 062e08fa447..4e4e2c3825a 100644
--- a/usr.bin/tmux/server-client.c
+++ b/usr.bin/tmux/server-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-client.c,v 1.84 2013/01/30 17:00:17 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.85 2013/03/21 16:14:09 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -418,6 +418,7 @@ server_client_handle_key(struct client *c, int key)
if (!(c->flags & CLIENT_PREFIX)) {
if (isprefix) {
c->flags |= CLIENT_PREFIX;
+ server_status_client(c);
return;
}
@@ -432,6 +433,7 @@ server_client_handle_key(struct client *c, int key)
/* Prefix key already pressed. Reset prefix and lookup key. */
c->flags &= ~CLIENT_PREFIX;
+ server_status_client(c);
if ((bd = key_bindings_lookup(key | KEYC_PREFIX)) == NULL) {
/* If repeating, treat this as a key, else ignore. */
if (c->flags & CLIENT_REPEAT) {
@@ -587,8 +589,11 @@ server_client_repeat_timer(unused int fd, unused short events, void *data)
{
struct client *c = data;
- if (c->flags & CLIENT_REPEAT)
+ if (c->flags & CLIENT_REPEAT) {
+ if (c->flags & CLIENT_PREFIX)
+ server_status_client(c);
c->flags &= ~(CLIENT_PREFIX|CLIENT_REPEAT);
+ }
}
/* Check if client should be exited. */