-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix copy-on-select: override to clipboard and fix ghostty UAF #2715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1798,6 +1798,12 @@ class GhosttyApp { | |
| prefix: "cmux-shell-integration-override", | ||
| logLabel: "shell integration override (fallback)" | ||
| ) | ||
| loadInlineGhosttyConfig( | ||
| "copy-on-select = clipboard", | ||
| into: fallbackConfig, | ||
| prefix: "cmux-copy-on-select", | ||
| logLabel: "copy-on-select override (fallback)" | ||
| ) | ||
| usesHostLayerBackground = true | ||
| ghostty_config_finalize(fallbackConfig) | ||
| updateDefaultBackground(from: fallbackConfig, source: "initialize.fallbackConfig") | ||
|
|
@@ -1887,6 +1893,17 @@ class GhosttyApp { | |
| ghostty_config_load_recursive_files(config) | ||
| loadCmuxAppSupportGhosttyConfigIfNeeded(config) | ||
| loadCJKFontFallbackIfNeeded(config) | ||
| // Ghostty's default copy-on-select = true writes to a private | ||
| // named pasteboard (com.mitchellh.ghostty.selection) that is not | ||
| // the system clipboard. Override to "clipboard" so that selecting | ||
| // text copies to NSPasteboard.general and Cmd+V works as macOS | ||
| // users expect. | ||
| loadInlineGhosttyConfig( | ||
| "copy-on-select = clipboard", | ||
| into: config, | ||
| prefix: "cmux-copy-on-select", | ||
| logLabel: "copy-on-select override" | ||
| ) | ||
|
Comment on lines
+1901
to
+1906
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because This is the same architectural pattern used for
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. A few notes on why this is an intentional forced override for now:
Adding a cmux settings key to let users opt out (back to
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ghostty's default The UAF this PR fixes was also in this code path, so before the fix the default was actively broken too. Same pattern as the
coderabbitai[bot] marked this conversation as resolved.
|
||
| let useHostLayerBackground = !hasConfiguredBackgroundImage(config) | ||
| usesHostLayerBackground = useHostLayerBackground | ||
| if !useHostLayerBackground { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.