Repository navigation
Conversation
When cmux ssh is used from a script, workspace.select is called immediately after workspace.remote.configure, stealing the user's active workspace focus before SSH is established. Add --no-focus flag (consistent with break-pane/join-pane) to skip the workspace.select call so the caller's workspace retains focus. The caller can then redirect to the new workspace later via cmux select-workspace. Addresses cmux ssh case of manaflow-ai#140; complementary to manaflow-ai#1418.
- Fix existing test that constructs SSHCommandOptions directly (add noFocus: false to the initializer call) - Make parseSSHCommandOptions internal so it's accessible from tests - Add testParseSSHCommandOptionsNoFocusFlag covering: - flag sets noFocus=true, destination parses correctly - absent flag defaults noFocus=false - combined with --name and --port
|
@maucher is attempting to deploy a commit to the Manaflow Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 Tip CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.OpenGrep is compatible with Semgrep configurations. Add an |
There was a problem hiding this comment.
No issues found across 2 files
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Greptile SummaryThis PR adds a Key changes:
The change is clean, minimal, and consistent with the codebase's existing Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant cmux CLI
participant App (workspace)
User->>cmux CLI: cmux ssh dev@host [--no-focus]
cmux CLI->>App (workspace): workspace.create
App (workspace)-->>cmux CLI: workspace_id
cmux CLI->>App (workspace): workspace.rename (if --name)
cmux CLI->>App (workspace): workspace.remote.configure
App (workspace)-->>cmux CLI: configuredPayload
alt --no-focus NOT set (default)
cmux CLI->>App (workspace): workspace.select
App (workspace)-->>User: Focus switches to new workspace
else --no-focus set
Note over cmux CLI,App (workspace): workspace.select skipped
Note over User: Caller retains active workspace focus
end
cmux CLI-->>User: OK workspace=... target=... state=...
Reviews (1): Last reviewed commit: "CLI: add test coverage for --no-focus fl..." | Re-trigger Greptile |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Superseded by #2227 (cherry-picked onto main with conflict resolution). Thank you for the contribution! |
Summary
Add
--no-focusflag tocmux sshso scripted/background SSH workspace creation does not steal the user's active workspace focus.Without this flag,
workspace.selectis called immediately afterworkspace.remote.configurereturns, switching the user away from their current workspace before SSH is even established. With--no-focus, the workspace is created and configured but the caller's workspace retains focus. The caller can then redirect to the new workspace later viacmux select-workspace.Usage
Consistency
Follows the same pattern as
break-pane --no-focusandjoin-pane --no-focus.Changes
SSHCommandOptions: addnoFocus: BoolfieldparseSSHCommandOptions: parse--no-focusflag (also madeinternalfor testability)runSSH: guardworkspace.selectcall withif !sshOptions.noFocus--no-focusflagSSHCommandOptionsinitializer call; addtestParseSSHCommandOptionsNoFocusFlagTesting
Tested locally by compiling the CLI directly and running against a live cmux socket:
Also verified:
--no-focusalongside other flags (--name,--port) parses correctlytestParseSSHCommandOptionsNoFocusFlagadded toCLIProcessRunnerTestsIssues
Addresses the
cmux sshcase of #140 ("CLI commands should not change focus state") and is complementary to #1418 (new-surface: add --no-focus flag).