Skip to content

Returning to Chat leaves the desktop terminal at phone width #472

Closed

Description

@praveng

Problem

Following up on #361. On 0.3.49, going straight to Chat keeps the desktop terminal width, which is great.

If I open Terminal on my phone and then switch back to Chat, the desktop terminal stays narrow.

Proposal

When I leave Terminal for Chat, can it give back control of the size so the desktop returns to normal? It should not overwrite a resize from another client.

Where

Chat and prompt cards; Terminal

Activity

  1. devswha commented on Oct 9, 2026

    @devswha
    Owner

    Re-checked on v0.4.2 (b82584d): still as described.

    Why: when a device leaves Terminal for Chat, PaneTerminal only marks its attach keep_size on the client (src/lib/ws.ts keepSize) and sends nothing, so the shared pty stays at the last grid an interact client set, the phone's. The desktop re-asserts its own grid only on its own resize, window focus or visibilitychange (refit in src/components/PaneTerminal.tsx). A desktop that stays focused keeps the phone's width until it is clicked away and back.

    There is no fix without a design choice, because the server is never told that the phone stopped showing the terminal:

    1. A release frame. Leaving Terminal sends a new WS message; the server then resizes the pty to the grid of an interact client still showing the terminal (or asks those clients to re-assert). No ping-pong, since a device in Chat never claims the size. Cost: a protocol change in shared/protocol.ts, a contract test, an answer in the demo transport, and a remote bundle bump so remote PCs understand it.
    2. Re-assert on the desktop's next input. No new frame: after another device resized the pty, the desktop re-fits on its next key or click in the terminal. Cheap, but the desktop stays narrow while someone only watches it, and two devices both typing in Terminal trade the size back and forth, which is the ping-pong this issue asks to avoid.
    3. A periodic or geometry-triggered re-assert from the desktop. Rejected: with the phone still in Terminal, the two clients resize each other in a loop.

    Option 1 is the one that does what the issue asks. It is a protocol change, so it waits for a maintainer decision.

  2. added a commit that references this issue on Oct 14, 2026
    001cd89
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions