=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-select-pane.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- src/usr.bin/tmux/cmd-select-pane.c 2018/06/25 17:23:16 1.44 +++ src/usr.bin/tmux/cmd-select-pane.c 2018/10/18 08:38:01 1.45 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-select-pane.c,v 1.44 2018/06/25 17:23:16 nicm Exp $ */ +/* $OpenBSD: cmd-select-pane.c,v 1.45 2018/10/18 08:38:01 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -54,6 +54,31 @@ .exec = cmd_select_pane_exec }; +static void +cmd_select_pane_redraw(struct window *w) +{ + struct client *c; + + /* + * Redraw entire window if it is bigger than the client (the + * offset may change), otherwise just draw borders. + */ + + TAILQ_FOREACH(c, &clients, entry) { + if (c->session == NULL) + continue; + if (c->session->curw->window == w && tty_window_bigger(&c->tty)) + server_redraw_client(c); + else { + if (c->session->curw->window == w) + c->flags |= CLIENT_REDRAWBORDERS; + if (session_has(c->session, w)) + c->flags |= CLIENT_REDRAWSTATUS; + } + + } +} + static enum cmd_retval cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item) { @@ -87,8 +112,7 @@ window_redraw_active_switch(w, lastwp); if (window_set_active_pane(w, lastwp)) { cmd_find_from_winlink(current, wl, 0); - server_status_window(w); - server_redraw_window_borders(w); + cmd_select_pane_redraw(w); } } return (CMD_RETURN_NORMAL); @@ -168,16 +192,11 @@ if (wp == w->active) return (CMD_RETURN_NORMAL); server_unzoom_window(wp->window); - if (!window_pane_visible(wp)) { - cmdq_error(item, "pane not visible"); - return (CMD_RETURN_ERROR); - } window_redraw_active_switch(w, wp); if (window_set_active_pane(w, wp)) { cmd_find_from_winlink_pane(current, wl, wp, 0); hooks_insert(s->hooks, item, current, "after-select-pane"); - server_status_window(w); - server_redraw_window_borders(w); + cmd_select_pane_redraw(w); } return (CMD_RETURN_NORMAL);