Hide the zoomed panes when a covered tiled pane is activated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Michael Grant
2026-10-01 17:56:43 +01:00
parent 42f6f3ca26
commit 0ce3f20a2d
10 changed files with 164 additions and 32 deletions

View File

@@ -320,7 +320,7 @@ check_ok resize-pane -Z -t "$p0"
check_fmt "$p0" '#{window_zoomed_flag}' '0'
# Splitting while zoomed with -d leaves the zoom alone; without -d the new
# pane is active and covered, so selecting it unzooms.
# pane is active and covered, so selecting it hides the zoomed pane.
check_ok resize-pane -Z -t "$p0"
check_fmt 'P:0' '#{window_zoomed_flag}' '1'
check_ok split-window -d -v -t "$p0"
@@ -334,16 +334,25 @@ check_fmt 'P:0' '#{window_zoomed_flag}' '0'
check_ok resize-pane -Z -t "$p0"
check_ok split-window -v -t "$p0"
check_fmt 'P:0' '#{window_zoomed_flag}' '0'
check_fmt "$p0" '#{pane_zoomed_flag}:#{pane_hidden_flag}' '1:1'
p6=$($TMUX display-message -p -t P:0 '#{pane_id}')
check_ok kill-pane -t "$p6"
check_ok resize-pane -a -H -t "$p0"
check_ok resize-pane -a -Z -t "$p0"
# Zoom and unzoom preserve the exact tiled layout. Selecting another pane
# without -Z unzooms, while -Z transfers zoom to the selected pane.
# without -Z hides the zoomed pane until the desktop shows it, while -Z
# transfers zoom to the selected pane.
layout=$(pane_layout P:0)
check_ok select-pane -t "$p0"
check_ok resize-pane -Z -t "$p0"
check_ok select-pane -t "$p2"
check_fmt "$p2" '#{window_zoomed_flag}:#{pane_active}' '0:1'
check_fmt "$p0" '#{pane_zoomed_flag}:#{pane_hidden_flag}' '1:1'
check_ok resize-pane -a -H -t "$p0"
check_fmt "$p0" '#{window_zoomed_flag}:#{pane_zoomed_flag}:#{pane_active}' \
'1:1:1'
check_ok resize-pane -a -Z -t "$p0"
check_layout P:0 "$layout"
check_ok select-pane -t "$p0"
@@ -355,7 +364,7 @@ check_ok resize-pane -Z -t "$p2"
check_layout P:0 "$layout"
# Directional selection temporarily restores the full layout to find its
# neighbour, then follows the same unzoom or -Z transfer rules.
# neighbour, then follows the same hide or -Z transfer rules.
check_ok select-pane -t "$p0"
check_ok resize-pane -Z -t "$p0"
check_ok select-pane -t "$p0"
@@ -363,6 +372,9 @@ check_fmt "$p0" '#{window_zoomed_flag}:#{pane_zoomed_flag}:#{pane_active}' \
'1:1:1'
check_ok select-pane -D -t "$p0"
check_fmt "$p2" '#{window_zoomed_flag}:#{pane_active}' '0:1'
check_fmt "$p0" '#{pane_zoomed_flag}:#{pane_hidden_flag}' '1:1'
check_ok resize-pane -a -H -t "$p0"
check_ok resize-pane -a -Z -t "$p0"
check_ok select-pane -t "$p0"
check_ok resize-pane -Z -t "$p0"
@@ -379,6 +391,9 @@ check_ok resize-pane -Z -t "$p2"
check_ok select-pane -l -t P:0
check_fmt "$p0" '#{window_zoomed_flag}:#{pane_zoomed_flag}:#{pane_active}' \
'0:0:1'
check_fmt "$p2" '#{pane_zoomed_flag}:#{pane_hidden_flag}' '1:1'
check_ok resize-pane -a -H -t "$p0"
check_ok resize-pane -a -Z -t "$p0"
check_ok select-pane -t "$p0"
check_ok select-pane -t "$p2"