Skip to content

terminal: a fresh keep_size attach resizes the pane, and an out-of-use lens draws at its own size (follow-up to #658) #662

Closed

Description

@devswha

Follow-up from #658 (merged as 502aee1). Both limits predate #658; its new out-of-use paths now rely on them, so they matter more than before. Found by the Codex (gpt-6.1-sol, xhigh) adversarial pass on #658, inferred from code and the repository's recorded measurement, not reproduced live.

1. A fresh keep_size attach can still change the pane's size (server).
server/index.ts (around line 856): when no web attachment remains, a keep_size attach creates the sidecar at the snapshot's layout rectangle, or 80x24 without one. server/AGENTS.md already notes that the layout rectangle is not the terminal's current geometry. Scenario: a pane left at 140x40, the last attachment released, then an unfocused page reloads and attaches with keep_size: the spawn itself resizes the pane, e.g. to 120x40.
Possible fix: use authoritative current geometry when herdr reports it; otherwise defer a fresh background attachment until the tab is in use. Test: the next pane was resized earlier and its attachment released.

2. An out-of-use terminal lens draws at its own size, not the shared one (client).
src/components/PaneTerminal.tsx: the terminal lens ignores pane-geometry, and its ResizeObserver keeps fitting xterm locally while out of use. With #658 the pty keeps the phone's grid (correct), but a desktop tab left visible beside another app parses the stream at its own columns and rows, so its drawing can be misplaced or clipped until the user comes back to it and it refits.
Possible fix: while out of use, adopt the shared grid from pane-geometry, keep background fits from replacing it, and force-fit when the tab is in use again; send geometry before replay bytes for preserved-size attachments.

Related: #472 (a focused desktop does not reclaim the size after the phone returns to Chat).

Activity

  1. added a commit that references this issue on Oct 9, 2026
  2. devswha commented on Oct 10, 2026

    @devswha
    OwnerAuthor

    Reproduced on main 5d18c53 with herdr 0.9.3. The size hold is herdr's attach contract (herdrdev/herdr#5036 was closed as intended behaviour), and herdr reports no pane width, so the bridge cannot join at the pane's own size. Waiting on herdrdev/herdr#4682; measurements added there.

  3. devswha commented on Oct 12, 2026

    @devswha
    OwnerAuthor

    The parts of this issue that main already covers are done. The remaining work moves to #902, so this issue can close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions