Repository navigation
fix(ssh): keep local shells local when restoring a preserved SSH TUI workspace - #14238
teamleaderleo wants to merge 2 commits into
Conversation
…workspace Since 5f0d222, createPanel sent every terminal snapshot in a preserved SSH TUI workspace to restoreDeviceDisplayPanel, so a local shell saved in that workspace came back as a disconnected remote mirror and lost its shell and working directory. Projected SSH terminals carry a surface projection record in the snapshot and local shells do not, so restore as a device mirror only when there is a projection record or the snapshot was not saved as a local terminal. Re-enables testPersistentSSHPTYRestorePreservesLocalTerminalWorkingDirectory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 2 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
All contributors have signed the CLA ✍️ ✅ |
A mirror pane can be saved before its projection exists (a reservation, respawn, or failed creation). It was saved with isRemoteTerminal false and no projection record, so the narrowed restore check would have brought it back as a local shell. Save manual-mirror panes in an SSH TUI workspace as remote, and correct the restore comment: projected SSH terminals restore through reserveRestoredCloudTerminalPane before this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Closing: #14119 retired testPersistentSSHPTYRestorePreservesLocalTerminalWorkingDirectory and now restores legacy persistent SSH snapshots as a blocked descriptor, and SSHTuiWorkspaceCoordinator is built on the rule that an SSH workspace never starts a local shell. Given that, restoring every terminal in a preserved SSH TUI workspace as a mirror is the intended design rather than a regression, so this change would work against it. |
Pull request was closed
Restoring a preserved SSH workspace turned every local shell inside it into a disconnected remote mirror.
Cause
5f0d222 (#13866) added this to
Workspace.createPanel:It catches every terminal snapshot in the workspace, including a local shell saved with
isRemoteTerminal == false. That shell comes back as a device mirror with no local process and no working directory.testPersistentSSHPTYRestorePreservesLocalTerminalWorkingDirectorycaught it; #14222 parked it behind a skip.Fix
cloudProjectionRecord != nil || snapshot.terminal?.isRemoteTerminal != false. Projected SSH terminals are unaffected: they restore throughreserveRestoredCloudTerminalPanebefore this branch. Snapshots from beforeisRemoteTerminalexisted (nil) still restore as mirrors. A terminal saved as local, with no projection, restores through the normal local path, and no remote startup or attach command is added (effectiveRemoteTerminalStartupCommandis nil for a TUI-owned persistent config, andtuiSSHConfigurationsets no daemon slot).isRemoteTerminal == false, which the narrowed check would read as a local shell. Manual-mirror panes in an SSH TUI workspace are now saved as remote. Every live mirror pane previously savedfalse, so the remaining readers of the flag (crash-storage scrollback, sidebar directory trust) now treat mirrors as remote, which matches what they are.testPersistentSSHPTYRestorePreservesLocalTerminalWorkingDirectoryis re-enabled.Known gap, not a regression: in a workspace that restores with a cmux-tui
cloudVMBinding,restoresUntrustedSavedDirectorystill drops the local shell's saved directory, so it opens in the default directory. Before this PR it didn't come back as a shell at all.🤖 Generated with Claude Code