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.
This commit is contained in:
Nicholas Marriott
2013-10-06 21:21:52 +01:00
parent d86c70af96
commit aa0a57fd56
3 changed files with 40 additions and 13 deletions

View File

@ -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);