You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Returning to Chat leaves the desktop terminal at phone width #472
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.
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.tskeepSize) 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:
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.
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.
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.
Activity
devswha commentedon Oct 9, 2026
Re-checked on v0.4.2 (b82584d): still as described.
Why: when a device leaves Terminal for Chat,
PaneTerminalonly marks its attachkeep_sizeon the client (src/lib/ws.tskeepSize) 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, windowfocusorvisibilitychange(refitinsrc/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:
shared/protocol.ts, a contract test, an answer in the demo transport, and a remote bundle bump so remote PCs understand it.Option 1 is the one that does what the issue asks. It is a protocol change, so it waits for a maintainer decision.
fix(terminal): take the pty back from the phone's input line and key …
fix(terminal): give the shared grid back when a phone returns to Chat (…
fix(terminal): hand the shared grid only to a device still showing th…
fix(terminal): keep the grid on a visible unfocused desktop
fix(terminal): keep the grid on a desktop that is visible but unfocus…