Show a hidden pane when it is zoomed, and skip hidden panes when moving.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Michael Grant
2026-10-01 11:14:28 +01:00
parent c50d075122
commit 24d0ead2b2
2 changed files with 37 additions and 6 deletions

View File

@@ -339,4 +339,36 @@ after=$(run list-panes -F '#{pane_id}:#{pane_height}') || exit 1
[ "$sizes" = "$after" ] || fail "sizes changed: '$sizes' became '$after'"
run set-hook -gu window-layout-changed
# Zooming a pane shows it, even if it is hidden and already the active pane.
reset
run resize-pane -H -t "$A"
run resize-pane -H -t "$B"
act=$(run display-message -p -t "$A" '#{?pane_active,1,0}') || exit 1
if [ "$act" = 1 ]; then
p=$A
else
p=$B
fi
hidden "$p" 1
run resize-pane -Z -t "$p"
hidden "$p" 0
check "$p" '#{pane_zoomed_flag}:#{pane_active}' '1:1'
# Moving to the pane at the left or right skips a hidden floating pane. The
# floating pane is flush with the right edge so moving left from the tiled pane
# wraps round to it.
reset
$TMUX kill-server 2>/dev/null
run new-session -d -x 80 -y 24
A=$(run display-message -p '#{pane_id}') || exit 1
X=$(run new-pane -dPF '#{pane_id}' -t "$A" -x 18 -y 6 -X 63 -Y 5 '') || exit 1
run select-pane -t "$A"
run select-pane -L -t "$A"
check "$X" '#{pane_active}' 1
run select-pane -t "$A"
run resize-pane -H -t "$X"
run select-pane -L -t "$A"
check "$A" '#{pane_active}' 1
hidden "$X" 1
exit 0

View File

@@ -1199,8 +1199,7 @@ window_zoom(struct window_pane *wp)
w->flags |= WINDOW_ZOOMED;
window_raise_pane(wp);
layout_fix_panes(w, NULL);
if (w->active != wp)
window_set_active_pane(w, wp, 1);
window_set_active_pane(w, wp, 1);
if (!was_zoomed)
events_fire_window("window-zoomed", w);
@@ -2453,7 +2452,7 @@ window_pane_find_up(struct window_pane *wp)
TAILQ_FOREACH(next, &w->panes, entry) {
window_pane_layout_size_offset(next, &xoff, &yoff, &sx, &sy);
if (next == wp)
if (next == wp || (next->flags & PANE_HIDDEN))
continue;
if (yoff + (int)sy + 1 != edge)
continue;
@@ -2514,7 +2513,7 @@ window_pane_find_down(struct window_pane *wp)
TAILQ_FOREACH(next, &w->panes, entry) {
window_pane_layout_size_offset(next, &xoff, &yoff, &sx, &sy);
if (next == wp)
if (next == wp || (next->flags & PANE_HIDDEN))
continue;
if (yoff != edge)
continue;
@@ -2566,7 +2565,7 @@ window_pane_find_left(struct window_pane *wp)
TAILQ_FOREACH(next, &w->panes, entry) {
window_pane_layout_size_offset(next, &xoff, &yoff, &sx, &sy);
if (next == wp)
if (next == wp || (next->flags & PANE_HIDDEN))
continue;
if (xoff + (int)sx + 1 != edge)
continue;
@@ -2618,7 +2617,7 @@ window_pane_find_right(struct window_pane *wp)
TAILQ_FOREACH(next, &w->panes, entry) {
window_pane_layout_size_offset(next, &xoff, &yoff, &sx, &sy);
if (next == wp)
if (next == wp || (next->flags & PANE_HIDDEN))
continue;
if (xoff != edge)
continue;