aboutsummaryrefslogtreecommitdiff
path: root/format.c
diff options
context:
space:
mode:
authornicm <nicm>2017-04-05 10:49:46 +0000
committernicm <nicm>2017-04-05 10:49:46 +0000
commit9b28200578670183a0dc70f1d16d5642101a6982 (patch)
tree745e1455c441ab36e2b39ec9398bfb40c14c9a56 /format.c
parentab4a4b2ad0ce2c8fdb485bc0fe871571181eace8 (diff)
downloadrtmux-9b28200578670183a0dc70f1d16d5642101a6982.tar.gz
rtmux-9b28200578670183a0dc70f1d16d5642101a6982.tar.bz2
rtmux-9b28200578670183a0dc70f1d16d5642101a6982.zip
Give each client a name. This defaults to the tty name as before but
falls back to an alternative if the tty name is not available. This is clearer than overloading the client ttyname member and allows us to remove the path stored in the tty struct, it should always be the same as the client.
Diffstat (limited to 'format.c')
-rw-r--r--format.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/format.c b/format.c
index 7e78897f..5844a6ab 100644
--- a/format.c
+++ b/format.c
@@ -1139,11 +1139,11 @@ format_defaults_client(struct format_tree *ft, struct client *c)
if (ft->s == NULL)
ft->s = c->session;
+ format_add(ft, "client_name", "%s", c->name);
format_add(ft, "client_pid", "%ld", (long) c->pid);
format_add(ft, "client_height", "%u", tty->sy);
format_add(ft, "client_width", "%u", tty->sx);
- if (tty->path != NULL)
- format_add(ft, "client_tty", "%s", tty->path);
+ format_add(ft, "client_tty", "%s", c->ttyname);
format_add(ft, "client_control_mode", "%d",
!!(c->flags & CLIENT_CONTROL));