=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window.c,v retrieving revision 1.264 retrieving revision 1.265 diff -u -r1.264 -r1.265 --- src/usr.bin/tmux/window.c 2020/06/01 09:43:01 1.264 +++ src/usr.bin/tmux/window.c 2020/06/05 11:20:51 1.265 @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.264 2020/06/01 09:43:01 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.265 2020/06/05 11:20:51 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -436,14 +436,21 @@ } void -window_pane_send_resize(struct window_pane *wp, int yadjust) +window_pane_send_resize(struct window_pane *wp, int force) { struct window *w = wp->window; struct winsize ws; - u_int sy = wp->sy + yadjust; + u_int sy; if (wp->fd == -1) return; + + if (!force) + sy = wp->sy; + else if (wp->sy <= 1) + sy = wp->sy + 1; + else + sy = wp->sy - 1; log_debug("%s: %%%u resize to %u,%u", __func__, wp->id, wp->sx, sy); memset(&ws, 0, sizeof ws); @@ -877,8 +884,8 @@ wp->xoff = 0; wp->yoff = 0; - wp->sx = wp->osx = sx; - wp->sy = wp->osx = sy; + wp->sx = sx; + wp->sy = sy; wp->pipe_fd = -1; wp->pipe_event = NULL; @@ -918,6 +925,8 @@ if (event_initialized(&wp->resize_timer)) event_del(&wp->resize_timer); + if (event_initialized(&wp->force_timer)) + event_del(&wp->force_timer); RB_REMOVE(window_pane_tree, &all_window_panes, wp); @@ -998,7 +1007,14 @@ wme = TAILQ_FIRST(&wp->modes); if (wme != NULL && wme->mode->resize != NULL) wme->mode->resize(wme, sx, sy); - wp->flags |= (PANE_RESIZE|PANE_RESIZED); + + /* + * If the pane has already been resized, set the force flag and make + * the application resize twice to force it to redraw. + */ + if (wp->flags & PANE_RESIZE) + wp->flags |= PANE_RESIZEFORCE; + wp->flags |= PANE_RESIZE; } void