summaryrefslogtreecommitdiffstats
path: root/cmd-new-session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2010-12-11 18:39:25 +0000
committerNicholas Marriott <nicm@openbsd.org>2010-12-11 18:39:25 +0000
commit51487ed22f0acf199f64728f3efc15a3c9ad615f (patch)
treed7702647b5c8d0337b0f5708118359ebd78e95d6 /cmd-new-session.c
parent20ed20ea1eb996cbfc530688dac7646f58a43fe6 (diff)
Track the last session for a client and add a flag to switch-client and
a key binding (L) to move a client back to its last session.
Diffstat (limited to 'cmd-new-session.c')
-rw-r--r--cmd-new-session.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c
index 290d5a3b..573b0ebb 100644
--- a/cmd-new-session.c
+++ b/cmd-new-session.c
@@ -279,9 +279,17 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
if (!detached) {
if (ctx->cmdclient != NULL) {
server_write_client(ctx->cmdclient, MSG_READY, NULL, 0);
+ if (ctx->cmdclient->session != NULL) {
+ session_index(ctx->cmdclient->session,
+ &ctx->cmdclient->last_session);
+ }
ctx->cmdclient->session = s;
server_redraw_client(ctx->cmdclient);
} else {
+ if (ctx->curclient->session != NULL) {
+ session_index(ctx->curclient->session,
+ &ctx->curclient->last_session);
+ }
ctx->curclient->session = s;
server_redraw_client(ctx->curclient);
}