From 9b28200578670183a0dc70f1d16d5642101a6982 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 5 Apr 2017 10:49:46 +0000 Subject: 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. --- cmd-choose-client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd-choose-client.c') diff --git a/cmd-choose-client.c b/cmd-choose-client.c index 2a64da69..96a79534 100644 --- a/cmd-choose-client.c +++ b/cmd-choose-client.c @@ -28,7 +28,7 @@ */ #define CHOOSE_CLIENT_TEMPLATE \ - "#{client_tty}: #{session_name} " \ + "#{client_name}: #{session_name} " \ "[#{client_width}x#{client_height} #{client_termname}]" \ "#{?client_utf8, (utf8),}#{?client_readonly, (ro),} " \ "(last used #{t:client_activity})" @@ -85,7 +85,7 @@ cmd_choose_client_exec(struct cmd *self, struct cmdq_item *item) cur = idx = 0; TAILQ_FOREACH(c1, &clients, entry) { - if (c1->session == NULL || c1->tty.path == NULL) + if (c1->session == NULL) continue; if (c1 == item->client) cur = idx; @@ -97,7 +97,7 @@ cmd_choose_client_exec(struct cmd *self, struct cmdq_item *item) format_add(cdata->ft, "line", "%u", idx); format_defaults(cdata->ft, c1, NULL, NULL, NULL); - cdata->command = cmd_template_replace(action, c1->tty.path, 1); + cdata->command = cmd_template_replace(action, c1->name, 1); window_choose_add(wl->window->active, cdata); -- cgit