Skip SSH cleanup after moving the last remote surface (#2123)

* Add regression test for detached remote cleanup

* Skip SSH cleanup after remote surface transfer

* Add SSH lifecycle regression coverage

* Add SSH detach cleanup transfer regressions

* Transfer SSH cleanup ownership with detached remote terminals

* Document intentional SSH workspace focus

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
This commit is contained in:
Lawrence Chen 2026-03-25 17:51:56 -07:00 committed by GitHub
parent 58dc932248
commit 0a1d8c2289
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 437 additions and 8 deletions

View file

@ -3746,6 +3746,9 @@ struct CMUXCLI {
if let workspaceWindowId, !workspaceWindowId.isEmpty {
selectParams["window_id"] = workspaceWindowId
}
// `cmux ssh` is an explicit "open this remote workspace now" action,
// so we intentionally select the newly created workspace after wiring
// up the remote connection.
_ = try client.sendV2(method: "workspace.select", params: selectParams)
let remoteState = ((configuredPayload["remote"] as? [String: Any])?["state"] as? String) ?? "unknown"
cliDebugLog(