fix: keep the restored tmux windows following their client #40

Merged
aleksei merged 1 commit from fix/tmux-layout-manual-size into main 2026-11-06 09:45:19 +00:00
Owner

Problem

Load Layout from the session menu left every restored window tiny.

load_layout ran resize-window -a after select-layout. In tmux any
resize-window call pins the window to a manual size:

  • cmd-resize-window.c unconditionally sets window-size to manual and
    stores manual_sx/manual_sy;
  • -a takes the smallest client attached to a session that contains the
    window, and falls back to the session default-size (80x24) when there is
    none — which is the case for the sessions a background load creates with
    new-session -d and new-window -d;
  • with window-size manual recalculate_size() keeps returning the stored
    size, 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-layout resizes the window to the layout size and the ordinary
recalculation scales the cells to the client.

Verification

On a scratch server with a saved layout, before and after:

old: 01:s1:1 80x24 window-size=manual
new: 01:s1:1 80x24 window-size=latest
## Problem `Load Layout` from the session menu left every restored window tiny. `load_layout` ran `resize-window -a` after `select-layout`. In tmux any `resize-window` call pins the window to a manual size: - `cmd-resize-window.c` unconditionally sets `window-size` to `manual` and stores `manual_sx`/`manual_sy`; - `-a` takes the smallest client attached to a session that contains the window, and falls back to the session `default-size` (`80x24`) when there is none — which is the case for the sessions a background load creates with `new-session -d` and `new-window -d`; - with `window-size manual` `recalculate_size()` keeps returning the stored size, 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-layout` resizes the window to the layout size and the ordinary recalculation scales the cells to the client. ## Verification On a scratch server with a saved layout, before and after: ``` old: 01:s1:1 80x24 window-size=manual new: 01:s1:1 80x24 window-size=latest ```
aleksei deleted branch fix/tmux-layout-manual-size 2026-11-06 09:45:19 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zoo/infra!40
No description provided.