diff --git a/server-client.c b/server-client.c index b0615bba..26425c8f 100644 --- a/server-client.c +++ b/server-client.c @@ -1098,12 +1098,13 @@ server_client_dispatch(struct imsg *imsg, void *arg) if (gettimeofday(&c->activity_time, NULL) != 0) fatal("gettimeofday failed"); - if (s != NULL) - session_update_activity(s, &c->activity_time); tty_start_tty(&c->tty); server_redraw_client(c); recalculate_sizes(); + + if (s != NULL) + session_update_activity(s, &c->activity_time); break; case MSG_SHELL: if (datalen != 0) diff --git a/window-choose.c b/window-choose.c index 76e8c697..e5b34f42 100644 --- a/window-choose.c +++ b/window-choose.c @@ -497,7 +497,7 @@ window_choose_expand(struct window_pane *wp, struct session *s, u_int pos) sizeof *data->list); memmove(&data->list[pos + 2], &data->list[pos + 1], - (data->list_size - pos) * + (data->list_size - (pos + 1)) * sizeof *data->list); memcpy(&data->list[pos + 1], &data->old_list[i],