summaryrefslogtreecommitdiffstats
path: root/cmd-attach-session.c
diff options
context:
space:
mode:
authornicm <nicm>2019-11-29 16:04:07 +0000
committernicm <nicm>2019-11-29 16:04:07 +0000
commit67d995d1003ef215b292f772a8e5394eb50569c4 (patch)
tree53ea63998f9b0a78191a9e4b559a9d2c8eea4e93 /cmd-attach-session.c
parentc5d74b1debc404340dd2049c708f9eb599be706e (diff)
If a window appears in only one attached session, there is no point in
worrying about which is the latest client (there is only one).
Diffstat (limited to 'cmd-attach-session.c')
-rw-r--r--cmd-attach-session.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd-attach-session.c b/cmd-attach-session.c
index 6de734e5..477d3517 100644
--- a/cmd-attach-session.c
+++ b/cmd-attach-session.c
@@ -127,6 +127,7 @@ cmd_attach_session(struct cmdq_item *item, const char *tflag, int dflag,
gettimeofday(&s->last_attached_time, NULL);
server_redraw_client(c);
s->curw->flags &= ~WINLINK_ALERTFLAGS;
+ s->curw->window->latest = c;
} else {
if (server_client_open(c, &cause) != 0) {
cmdq_error(item, "open terminal failed: %s", cause);
@@ -159,6 +160,7 @@ cmd_attach_session(struct cmdq_item *item, const char *tflag, int dflag,
gettimeofday(&s->last_attached_time, NULL);
server_redraw_client(c);
s->curw->flags &= ~WINLINK_ALERTFLAGS;
+ s->curw->window->latest = c;
if (~c->flags & CLIENT_CONTROL)
proc_send(c->peer, MSG_READY, -1, NULL, 0);