Prevent display-panes from shifting the active pane scroll position by

copying the screen from before zoom, also do not let resize consume
blank lines.
This commit is contained in:
nicm
2026-07-17 16:03:15 +00:00
committed by tmux update bot
parent 377a810168
commit 496bfdce38
3 changed files with 60 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: window.c,v 1.364 2026/07/15 13:02:33 nicm Exp $ */
/* $OpenBSD: window.c,v 1.365 2026/07/17 16:03:15 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1556,6 +1556,12 @@ window_pane_resize(struct window_pane *wp, u_int sx, u_int sy)
struct window_pane_resize *r;
struct event_payload *ep;
struct cmd_find_state fs;
int trim = 1;
if (wp->flags & PANE_NORESIZETRIM) {
wp->flags &= ~PANE_NORESIZETRIM;
trim = 0;
}
if (sx == wp->sx && sy == wp->sy)
return;
@@ -1573,7 +1579,10 @@ window_pane_resize(struct window_pane *wp, u_int sx, u_int sy)
wp->sy = sy;
log_debug("%s: %%%u resize %ux%u", __func__, wp->id, sx, sy);
screen_resize(&wp->base, sx, sy, wp->base.saved_grid == NULL);
if (wp->base.saved_grid == NULL)
screen_resize_cursor(&wp->base, sx, sy, 1, trim, 1);
else
screen_resize_cursor(&wp->base, sx, sy, 0, trim, 1);
wme = TAILQ_FIRST(&wp->modes);
if (wme != NULL && wme->mode->resize != NULL)