(remote): make a solo tmux attach look and behave like a local terminal - #256
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
-g:status off,mouse on,window-size latest. Shared attach: command byte-identical to before.mouseandwindow-size.tmux show-options -Amarks 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 starredstatus offcounts 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.set -twith the pre-attach value for a session override,set -u -totherwise so the host's global applies again. Never blocks, never throws.public/terminal-manager.jshas no wheel/alt-scroll mapping that could double-scroll.On the current host
mouse onandwindow-size latestare 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 -ubranch → 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 -usequence against the live tmux server (tests only).