=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/server-client.c,v retrieving revision 1.294 retrieving revision 1.295 diff -u -r1.294 -r1.295 --- src/usr.bin/tmux/server-client.c 2019/08/28 07:34:32 1.294 +++ src/usr.bin/tmux/server-client.c 2019/09/19 09:02:30 1.295 @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.294 2019/08/28 07:34:32 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.295 2019/09/19 09:02:30 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -996,6 +996,24 @@ return (0); } +/* Has the latest client changed? */ +static void +server_client_update_latest(struct client *c) +{ + struct window *w; + + if (c->session == NULL) + return; + w = c->session->curw->window; + + if (w->latest == c) + return; + w->latest = c; + + if (options_get_number(w->options, "window-size") == WINDOW_SIZE_LATEST) + recalculate_size(w); +} + /* * Handle data key input from client. This owns and can modify the key event it * is given and is responsible for freeing it. @@ -1192,6 +1210,8 @@ window_pane_key(wp, c, s, wl, key, m); out: + if (s != NULL) + server_client_update_latest(c); free(event); return (CMD_RETURN_NORMAL); } @@ -1737,6 +1757,7 @@ if (c->flags & CLIENT_CONTROL) break; + server_client_update_latest(c); server_client_clear_overlay(c); tty_resize(&c->tty); recalculate_sizes();