2
0
Fork 0

fix: keep the terminal size across route changes #36

Merged
aleksei merged 1 commit from feat/cache-xterm-size into main 2026-11-05 09:27:45 +00:00
Owner

The session list is a separate route, so opening it unmounts xterm. On return, xterm started at 80×24 and the server attached the PTY at the same default size; both then resized to the real container, which is the visible reflow.

  • Cache the last fitted cols/rows per window and font size in memory, and construct xterm at that size. A fit still runs before connecting and corrects a changed layout.
  • Put the fitted size in the terminal WebSocket query. The server clamps it and opens the PTY at that size instead of starting at 80×24.
  • Track the size sent to the socket and skip a duplicate resize after ready, so a reattach at the same size sends no extra control frame.

Tests: 54 unit + terminal/tmux/API integration pass; npm run typecheck and build pass. On a temporary instance, the shell and returned shell both connected with cols=39&rows=39; no body scroll.

The session list is a separate route, so opening it unmounts xterm. On return, xterm started at 80×24 and the server attached the PTY at the same default size; both then resized to the real container, which is the visible reflow. - Cache the last fitted `cols`/`rows` per window and font size in memory, and construct xterm at that size. A fit still runs before connecting and corrects a changed layout. - Put the fitted size in the terminal WebSocket query. The server clamps it and opens the PTY at that size instead of starting at 80×24. - Track the size sent to the socket and skip a duplicate resize after `ready`, so a reattach at the same size sends no extra control frame. Tests: 54 unit + terminal/tmux/API integration pass; `npm run typecheck` and build pass. On a temporary instance, the shell and returned shell both connected with `cols=39&rows=39`; no body scroll.
Author
Owner

Validated on a real iPhone after deploying the branch: the terminal keeps its size when leaving for the session list and returning; no fit/reflow flash. Ready to merge.

Validated on a real iPhone after deploying the branch: the terminal keeps its size when leaving for the session list and returning; no fit/reflow flash. Ready to merge.
aleksei deleted branch feat/cache-xterm-size 2026-11-05 09:27:45 +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/mux-portal!36
No description provided.