diff options
-rw-r--r-- | format.c | 2 | ||||
-rw-r--r-- | server-client.c | 7 | ||||
-rw-r--r-- | status.c | 4 | ||||
-rw-r--r-- | tmux.1 | 2 |
4 files changed, 12 insertions, 3 deletions
@@ -322,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 diff --git a/server-client.c b/server-client.c index 796390f7..e683a206 100644 --- a/server-client.c +++ b/server-client.c @@ -417,6 +417,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; } @@ -431,6 +432,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) { @@ -586,8 +588,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. */ @@ -437,8 +437,7 @@ status_replace1(struct client *c, struct session *s, struct winlink *wl, case 'P': if (window_pane_index(wp, &idx) != 0) fatalx("index not found"); - xsnprintf( - tmp, sizeof tmp, "%u", idx); + xsnprintf(tmp, sizeof tmp, "%u", idx); ptr = tmp; goto do_replace; case 'S': @@ -539,6 +538,7 @@ status_replace(struct client *c, struct session *s, struct winlink *wl, *optr = '\0'; ft = format_create(); + format_client(ft, c); format_session(ft, s); format_winlink(ft, s, wl); format_window_pane(ft, wp); @@ -2370,6 +2370,7 @@ may contain any of the following special character sequences: .It Li "#S" Ta "Session name" .It Li "#T" Ta "Current pane title" .It Li "#W" Ta "Current window name" +.It Li "'^" Ta "Prefix key if pressed or same length as spaces" .It Li "##" Ta "A literal" Ql # .El .Pp @@ -2939,6 +2940,7 @@ The following variables are available, where appropriate: .It Li "client_created_string" Ta "String time client created" .It Li "client_cwd" Ta "Working directory of client" .It Li "client_height" Ta "Height of client" +.It Li "client_prefix" Ta "1 if prefix key has been pressed" .It Li "client_readonly" Ta "1 if client is readonly" .It Li "client_termname" Ta "Terminal name of client" .It Li "client_tty" Ta "Pseudo terminal of client" |