Repository navigation
Fix copy-on-select Ghostty parity - #6200
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough
Changescopy-on-select managed config fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 20 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (20 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Greptile SummaryThis PR fixes copy-on-select parity with Ghostty by changing cmux's managed terminal config to omit
Confidence Score: 5/5Safe to merge — the change is narrowly scoped to omitting a Ghostty config key rather than forcing it, localizations are complete across all supported locales, and the new layering tests provide solid regression coverage. The core production change is a single call-site flip from emitting No files require special attention. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User as User (Settings)
participant Defaults as UserDefaults
participant TMGS as TerminalManagedGhosttySettings
participant TCOS as TerminalCopyOnSelectSettings
participant GhosttyApp as GhosttyApp
participant Ghostty as Ghostty Config
User->>Defaults: "set copyOnSelect = false (toggle off)"
GhosttyApp->>TMGS: ghosttyConfigContents(emitsCopyOnSelectFalse: false)
TMGS->>TCOS: ghosttyConfigContents(defaults, emitsFalse: false)
TCOS->>TCOS: storedValue() → false
TCOS-->>TMGS: nil (no override emitted)
TMGS-->>GhosttyApp: nil → guard returns early
Note over Ghostty: Ghostty config / defaults retain authority
User->>Defaults: "set copyOnSelect = true (toggle on)"
GhosttyApp->>TMGS: ghosttyConfigContents(emitsCopyOnSelectFalse: false)
TMGS->>TCOS: ghosttyConfigContents(defaults, emitsFalse: false)
TCOS->>TCOS: storedValue() → true
TCOS-->>TMGS: "copy-on-select = clipboard"
TMGS-->>GhosttyApp: "copy-on-select = clipboard"
GhosttyApp->>Ghostty: loadInlineGhosttyConfig
Note over Ghostty: System clipboard updated on every selection
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant User as User (Settings)
participant Defaults as UserDefaults
participant TMGS as TerminalManagedGhosttySettings
participant TCOS as TerminalCopyOnSelectSettings
participant GhosttyApp as GhosttyApp
participant Ghostty as Ghostty Config
User->>Defaults: "set copyOnSelect = false (toggle off)"
GhosttyApp->>TMGS: ghosttyConfigContents(emitsCopyOnSelectFalse: false)
TMGS->>TCOS: ghosttyConfigContents(defaults, emitsFalse: false)
TCOS->>TCOS: storedValue() → false
TCOS-->>TMGS: nil (no override emitted)
TMGS-->>GhosttyApp: nil → guard returns early
Note over Ghostty: Ghostty config / defaults retain authority
User->>Defaults: "set copyOnSelect = true (toggle on)"
GhosttyApp->>TMGS: ghosttyConfigContents(emitsCopyOnSelectFalse: false)
TMGS->>TCOS: ghosttyConfigContents(defaults, emitsFalse: false)
TCOS->>TCOS: storedValue() → true
TCOS-->>TMGS: "copy-on-select = clipboard"
TMGS-->>GhosttyApp: "copy-on-select = clipboard"
GhosttyApp->>Ghostty: loadInlineGhosttyConfig
Note over Ghostty: System clipboard updated on every selection
Reviews (26): Last reviewed commit: "Merge branch 'main' into issue-6190-copy..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/messages/en.json`:
- Around line 929-930: The copyOnSelect description in the English and Japanese
locale files has been expanded to include explanation of false-value behavior,
but the other 18 supported locale catalogs (zh-CN, zh-TW, ko, de, es, fr, it,
da, pl, ru, bs, ar, no, pt-BR, th, tr, km, uk) still contain the old shorter
description. Update the copyOnSelect terminal property description in all 18
remaining locale JSON files to match the new expanded version that explains what
happens when the value is false and how it relates to Ghostty copy-on-select
override behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6fd24acc-4ea8-4cde-97f5-a9a620be8327
📒 Files selected for processing (9)
Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/TerminalSection.swiftResources/Localizable.xcstringsSources/App/WorkspaceRuntimeSettings.swiftcmux.xcodeproj/project.pbxprojcmuxTests/AgentSessionAutoResumeSettingsTests.swiftcmuxTests/TerminalCopyOnSelectManagedConfigLayeringTests.swiftweb/data/cmux.schema.jsonweb/messages/en.jsonweb/messages/ja.json
💤 Files with no reviewable changes (2)
- Sources/App/WorkspaceRuntimeSettings.swift
- cmuxTests/AgentSessionAutoResumeSettingsTests.swift
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Sources/App/WorkspaceRuntimeSettings.swift`:
- Around line 161-164: The `ghosttyCopyOnSelectValue` function lacks
documentation for the `emitsFalse` parameter, which controls critical behavior.
Add a docstring to the `ghosttyCopyOnSelectValue` function that documents what
the `emitsFalse` parameter does, specifically explaining that when set to
`false`, it omits the managed config line entirely, allowing user Ghostty config
and macOS defaults to take precedence. Include in the documentation that this
behavior fixes a regression where cmux would override user settings, so future
maintainers understand when and why to pass `false` versus `true`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6685a030-dbc1-4fd5-b934-5f1296709f78
📒 Files selected for processing (21)
Sources/App/WorkspaceRuntimeSettings.swiftSources/GhosttyTerminalView.swiftcmuxTests/TerminalCopyOnSelectManagedConfigLayeringTests.swiftweb/messages/ar.jsonweb/messages/bs.jsonweb/messages/da.jsonweb/messages/de.jsonweb/messages/es.jsonweb/messages/fr.jsonweb/messages/it.jsonweb/messages/km.jsonweb/messages/ko.jsonweb/messages/no.jsonweb/messages/pl.jsonweb/messages/pt-BR.jsonweb/messages/ru.jsonweb/messages/th.jsonweb/messages/tr.jsonweb/messages/uk.jsonweb/messages/zh-CN.jsonweb/messages/zh-TW.json
4aa275b to
dbe3eba
Compare
Summary
copy-on-select = falsefrom cmux managed terminal config when the Copy on Selection toggle is off/defaultcopy-on-select = trueso mouse selection updates the selection pasteboard used by Shift+Cmd+Vcopy-on-selectvalues and neighboring terminal settings so cmux managed config cannot clobber user Ghostty configTrade-off
The existing Settings toggle stays a boolean for the current user-facing behavior: enabling it opts into Ghostty
clipboardmode so selections also replace the system clipboard. Disabling/defaulting it now omits the managed Ghostty key instead of forcingfalse, so Ghostty's tri-state default and the user's own Ghostty config retain authority over selection-clipboard behavior.Tests
git diff --checkgit diff --cached --checkgit diff --check origin/main...HEAD./scripts/lint-pbxproj-test-wiring.shpython3 scripts/swift_file_length_budget.py --budget .github/swift-file-length-budget.tsv/Users/austinwang/manaflow/cmuxterm-hq/skills/autoreview/scripts/cmux-policy-check --mode local./scripts/lint-ios-package-conventions.sharch -arm64 env PATH='/usr/bin:/bin:/usr/sbin:/sbin' xcodebuild -project cmux.xcodeproj -scheme cmux -configuration Debug -derivedDataPath /tmp/cmux-issue-6190-copy-on-select-parity-ui-tests-arm64 -destination 'platform=macOS,arch=arm64' build-for-testing -only-testing:cmuxUITests/SettingsTerminalBehaviorUITestsCMUX_SKIP_ZIG_BUILD=1 ./scripts/reload.sh --tag issue-6190-copy-on-select-parityBlocked local check:
arch -arm64 xcrun swift test --package-path Packages/CmuxMobileShellUI --filter ComposerDictationTestscurrently fails before this branch's tests due the package declaring macOS 10.13 while dependencies require macOS 12/14.Fixes #6190
Summary by CodeRabbit
copy-on-selectoverride, so Ghostty configuration controls clipboard behavior.truevsfalsebehavior.copy-on-selectvalue resolution.