From 7936ce38749a4751120c856a112ee85122df612c Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 10 Oct 2013 12:28:08 +0000 Subject: Show session name in detached message. Requested by somebody a few months ago who didn't bother testing it. But it works for me anyway. --- cmd-attach-session.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'cmd-attach-session.c') diff --git a/cmd-attach-session.c b/cmd-attach-session.c index 8dcc5997..c71e6f1f 100644 --- a/cmd-attach-session.c +++ b/cmd-attach-session.c @@ -77,7 +77,9 @@ cmd_attach_session(struct cmd_q *cmdq, const char *tflag, int dflag, int rflag, continue; if (c == cmdq->client) continue; - server_write_client(c, MSG_DETACH, NULL, 0); + server_write_client(c, MSG_DETACH, + c->session->name, + strlen(c->session->name) + 1); } } @@ -138,8 +140,10 @@ cmd_attach_session(struct cmd_q *cmdq, const char *tflag, int dflag, int rflag, if (rflag) cmdq->client->flags |= CLIENT_READONLY; - if (dflag) - server_write_session(s, MSG_DETACH, NULL, 0); + if (dflag) { + server_write_session(s, MSG_DETACH, s->name, + strlen(s->name) + 1); + } update = options_get_string(&s->options, "update-environment"); environ_update(update, &cmdq->client->environ, &s->environ); -- cgit