Keep hidden tmux clients out of window sizing - #228
Conversation
A hidden client can race an immediate reopen while tmux updates its client flags. Main actor isolation does not preserve command order across those suspended operations. Queue each attachment's sizing changes and retain the latest intent during provisioning. An older hide can no longer leave a reopened client in non-sizing mode. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
An ordinary tmux client stayed attached as a sizing authority after its presentation was hidden. That invisible client could shrink the shared session viewport even when previews were off. Make hidden POSIX clients non-sizing and restore interactive sizing before reuse. If Ghosthub cannot update the exact client safely, detach it instead of retaining an invisible sizing client. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
A reconnect could restore sizing authority to an ordinary hidden tmux client. That invisible client could then resize the shared session before it was shown again. Carry the retained presentation's sizing intent into every reconnect. Windows clients remain user-owned, and Ghosthub does not change the global window-size policy. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
A canceled scene operation could leave its queued sizing transition running. That obsolete work could issue a tmux command after a newer presentation state had taken over. Propagate caller cancellation into the serialized transition and stop before the tmux operation starts. This keeps the queue ordered without reviving work that its owner canceled. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
roborev: Combined Review (
|
A second reopen could leave a retained tmux presentation tied to an older navigation revision. Its sizing task then rejected its own activation and repeatedly restarted without publishing the session. Make each reopen replace the pending revision and retire obsolete cleanup. Give the affected remote tests an exact-client response so they exercise the successful hidden-sizing path instead of racing an intentional detach. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
|
Fixed in
|
roborev: Combined Review (
|
Reopening a hidden session while its attachment was still resolving could leave it selected without an active client. The sizing transition correctly deferred to provisioning, but its scene marker disappeared before readiness could resume it. Keep current activation intent until surface readiness and discard only obsolete intent. This lets the selected client become interactive without reviving stale navigation. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
|
Fixed in
|
roborev: Combined Review (
|
A hidden client could apply its preview grid before tmux stopped using that client for shared window sizing. Detach and shutdown could also release an attachment while its last sizing command was still running. Set ignore-size before changing local preview geometry. Keep ownership of every sizing task through teardown, cancel it, and wait before releasing the SSH attachment. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
|
Fixed in
|
roborev: Combined Review (
|
A closing surface could start its replacement while an exact-client sizing command was still running. Older tmux versions could also receive sizing operations that depend on safe client targeting they do not provide. Make replacement attachment work wait for canceled sizing transitions. Gate hidden and reconnect sizing on the resolved capability, while keeping older tmux versions available for ordinary interactive use. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
|
Fixed in
|
roborev: Combined Review (
|
Reactivating a hidden retained tmux client stages the selection as active while the interactive sizing change is still in flight; the active handle is only committed once that change lands. A worktree removal that starts in that window recorded the presentation as inactive, so a failed removal either restored it hidden or, for a client that kwt must establish, did not restore it at all. The user's open was silently lost. The removal snapshot now treats a matching pending activation as active, so a failed removal brings the session back in front of the user as long as they have not navigated elsewhere since. Generated with Claude Code (claude-fable-5-1) Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
roborev: Combined Review (
|
A tmux disconnect could interrupt interactive sizing while a hidden client was being reopened. The stale sizing attempt then discarded the retained presentation before its replacement attachment was ready. Keep the activation pending across the disconnect and resume sizing only when the replacement attachment can take ownership. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
|
Addressed the reconnect race in
The regression failed against |
roborev: Combined Review (
|
Detach protected sessions whose socket is unresolved before hidden sizing can target the default server. Leave inactive Windows sessions detached during restoration because psmux cannot opt a client out of shared sizing.
|
Addressed both findings in
Verified with |
roborev: Combined Review (
|
Opening a session on a host that no longer resolves, such as a removed host or one without an SSH destination, moved the active selection but skipped the hidden-sizing step for the client the user just left. That client stayed retained, invisible, and still sizing the shared tmux session, which is the exact problem this branch removes. The unresolvable-host branch now runs the same deactivation as every other activation path, so the previous client is told to ignore its size before the selection changes. Also stop a launch failure from writing its closure and disconnect report for a handle that was closed while the SSH release was pending, and drop the redundant POSIX-only hidden flag that the Windows guard above it already guarantees. Generated with Claude Code (claude-fable-5-1) Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
The preview-sizing test listed tmux clients with a tab between the tty and its flags. tmux 3.7 prints that tab as an underscore unless the process runs with a UTF-8 locale, so the test failed on every run in a shell without LANG set even though the client flag was applied. The app is unaffected because it runs tmux through the user's login shell. Use a pipe separator so the check does not depend on the locale. Generated with Claude Code (claude-fable-5-1) Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
roborev: Combined Review (
|
Hidden retained tmux clients no longer resize the shared session viewport. Before this change, navigating away from a tmux session left its retained client attached as an ordinary sizing client, so the session kept following that invisible client's grid instead of the one the user was looking at.
ignore-sizeflag, whether it started hidden, was hidden after use, or reconnected. Ghosthub clears the flag on the exact client before making its surface interactive, and never touches the session's globalwindow-sizepolicy.Behaviour changes beyond sizing:
refresh-clientround trip before the new client is committed active. On remote hosts that is one SSH command per switch.