fix: keep the restored tmux windows following their client #40
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/tmux-layout-manual-size"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Load Layoutfrom the session menu left every restored window tiny.load_layoutranresize-window -aafterselect-layout. In tmux anyresize-windowcall pins the window to a manual size:cmd-resize-window.cunconditionally setswindow-sizetomanualandstores
manual_sx/manual_sy;-atakes the smallest client attached to a session that contains thewindow, and falls back to the session
default-size(80x24) when there isnone — which is the case for the sessions a background load creates with
new-session -dandnew-window -d;window-size manualrecalculate_size()keeps returning the storedsize, so the window no longer follows its client, not even after attaching.
Change
Unset the per-window override before applying the saved layout. The window
follows its client again, and the saved layout keeps only the split ratios:
select-layoutresizes the window to the layout size and the ordinaryrecalculation scales the cells to the client.
Verification
On a scratch server with a saved layout, before and after: