From 76b2ac69f8560889e85ac67e983bf1dcaf2c2cc2 Mon Sep 17 00:00:00 2001 From: Gahow Wang Date: Tue, 28 Jul 2026 23:53:01 +0800 Subject: [PATCH] fix: let active tmux clients control window size Keep the global window-size=latest policy for linked web and iOS sessions so switching between phone and Mac sends SIGWINCH and reflows the shared pane. --- scripts/tmux-web-attach.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/tmux-web-attach.sh b/scripts/tmux-web-attach.sh index 7b404de..8ef234b 100755 --- a/scripts/tmux-web-attach.sh +++ b/scripts/tmux-web-attach.sh @@ -44,14 +44,11 @@ tmux set-option -t "$tmp" mouse on first="$(tmux display-message -p -t "$tmp" '#{window_index}')" tmux link-window -k -s "$src" -t "$tmp:$first" -# A tmux window has a single size shared by every viewer. With the global -# "latest" policy a bigger local client cuts the browser view off, so pin this -# window to "smallest" while a web viewer is attached: the browser always sees -# the full content; a larger local client sees dotted padding instead. -tmux set-window-option -t "$src" window-size smallest +# A tmux window has one size shared by every viewer. Keep the global +# "window-size latest" policy so the most recently active Mac, web, or iOS +# client owns that size and full-screen programs receive SIGWINCH to reflow. cleanup() { - tmux set-window-option -u -t "$src" window-size 2>/dev/null || true tmux kill-session -t "$tmp" 2>/dev/null || true } trap cleanup EXIT HUP TERM INT