Skip to content

(remote): make a solo tmux attach look and behave like a local terminal - #256

Merged
devsuitup merged 2 commits into
mainfrom
feat/attach-solo-parity
Sep 11, 2026
Merged

(remote): make a solo tmux attach look and behave like a local terminal#256
devsuitup merged 2 commits into
mainfrom
feat/attach-solo-parity

Conversation

@devsuitup

Copy link
Copy Markdown
Owner

Closes #253.

Why

A remote session attached from Switchboard and a local session are the same xterm.js; the differences the user feels come from the tmux layer: the status bar, the wheel captured by tmux, the window sized by the smallest client. The host's configuration and the sessions other agents keep there must not change.

What

  • When Switchboard is the solo client (the existing solo/shared rule, fix(remote): follow the local window size on a solo attach #233), the attach command first sets, at session scope and never -g: status off, mouse on, window-size latest. Shared attach: command byte-identical to before.
  • The probe now also reads mouse and window-size. tmux show-options -A marks an inherited option with a star after its name (status* on, measured on the host, tmux 3.6): the parser now handles it — for sizing, a starred status off counts like an unstarred one (latent bug since fix(remote): follow the local window size on a solo attach #233); for restore, pre.<opt> is non-null only for a session-scoped override.
  • On detach of a solo attach, a best-effort one-shot ssh restores the three options: set -t with the pre-attach value for a session override, set -u -t otherwise so the host's global applies again. Never blocks, never throws.
  • No renderer change: public/terminal-manager.js has no wheel/alt-scroll mapping that could double-scroll.

On the current host mouse on and window-size latest are already global; only the status bar changes at attach.

Proof

Mutations on the shipped module: drop the sets in the solo branch → solo-order test red, shared green; no-op the restore → detach-restore test red; drop the set -u branch → null-unset test red; drop the star group in the option regex → "starred status sizes like unstarred" red. No built command contains a backtick (asserted).

task check: 1252 pass, 0 fail, 8 pre-existing skips.

Not verified on the wire: the set/set -u sequence against the live tmux server (tests only).

Issue #253: a solo remote attach still showed tmux's status bar and left
mouse-wheel scroll and window sizing at the multiplexer's own defaults, so it
read as a tmux session rather than a local terminal. Set status/mouse/
window-size at session scope on solo attach only, and restore the probed
pre-attach values on detach so a later plain-terminal user sees the host's
own configuration again; a shared attach is left untouched.
tmux show-options -A prints an inherited option as "status* on". The probe
parser missed the star, so inherited values read as absent and a global
status off skewed the sizing rule. pre.<opt> is now non-null only for a
session-scoped override; inherited or absent restores by set -u.
@devsuitup
devsuitup merged commit 4fa5216 into main Sep 11, 2026
10 checks passed
@devsuitup
devsuitup deleted the feat/attach-solo-parity branch September 11, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(remote): make a solo tmux attach look and behave like a local terminal

1 participant