diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2010-12-11 18:42:20 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2010-12-11 18:42:20 +0000 |
commit | 5fcd6711e4319a03349a9506d646767c73a5381a (patch) | |
tree | 13ecf2ecd2e73ee38e644ed069be19c5b31ed257 /cmd-new-session.c | |
parent | d227a2e661f32d3b5058357872ae3cf797d3cd42 (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.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c index 5f67691f..d09e2e7d 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -1,4 +1,4 @@ -/* $Id: cmd-new-session.c,v 1.78 2010-07-02 02:49:19 tcunha Exp $ */ +/* $Id: cmd-new-session.c,v 1.79 2010-12-11 18:42:20 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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); } |