feat(macos): add cmux as preferred terminal#1947
feat(macos): add cmux as preferred terminal#1947TaoXieSZ wants to merge 1 commit intofarion1231:mainfrom
Conversation
- Add cmux_macos helper: resolve CLI (PATH/Homebrew/login shell/bundle), run new-workspace + send, launch bundle main with CMUX_SOCKET_MODE=allowAll - Provider terminal (misc) and session resume use shared run_in_cmux; skip Terminal.app fallback when cmux fails so errors are visible - Tauri command restart_cmux_for_external_access + settings UI and i18n for one-click quit/relaunch when socket rejects external control Made-with: Cursor
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 659088fd10
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if result.is_err() && terminal != "terminal" { | ||
| // If preferred terminal fails and it's not the default, try Terminal.app as fallback. | ||
| // cmux: do not fall back — failures are usually PATH or cmux socket policy; user should see the error. | ||
| if result.is_err() && terminal != "terminal" && terminal != "cmux" { |
There was a problem hiding this comment.
Clean up temp credential files on cmux launch errors
The new terminal != "cmux" guard means cmux launch failures now return immediately without any cleanup path, even though launch_terminal_with_env has already written claude_<provider>_<pid>.json (with provider env/API keys) and cc_switch_launcher_<pid>.sh to temp storage. Those files are only removed by the shell trap inside the launcher script, which never executes when launch_macos_cmux fails (for example during the documented socket-permission failure path), so repeated failures can leave sensitive credentials on disk.
Useful? React with 👍 / 👎.
Summary
Adds cmux as a macOS Preferred Terminal option for opening the Claude provider terminal and for session resume.
Closes #1949
Problem
PATH(often missing Homebrew), socmuxCLI was not found.Failed to write to socketwhen CC Switch runscmux new-workspace/send.Solution
cmux_macosmodule: resolve CLI (CMUX_CLI, bundle paths, Homebrew, login-shellcommand -v), runnew-workspace+send, and start the app bundle main binary withCMUX_SOCKET_MODE=allowAllwhere possible.restart_cmux_for_external_accesscommand + settings UI (when cmux is selected) to quit and relaunch cmux with external socket access.i18n
en / zh / ja strings for the cmux hint and restart button.
Test plan
pnpm typecheckpassescargo checkpasses