Skip to content

fix: route clipboard writes through Electron IPC to prevent NSPasteboard contention#83

Merged
AmethystLiang merged 1 commit intomainfrom
AmethystLiang/fixPasteImage
Mar 24, 2026
Merged

fix: route clipboard writes through Electron IPC to prevent NSPasteboard contention#83
AmethystLiang merged 1 commit intomainfrom
AmethystLiang/fixPasteImage

Conversation

@AmethystLiang
Copy link
Copy Markdown
Contributor

Summary

  • Routes all navigator.clipboard.writeText() calls through Electron's native clipboard module via IPC (window.api.ui.writeClipboardText())
  • Adds clipboard:writeText IPC handler in the main process alongside the existing clipboard:readText
  • Denies clipboard-read and clipboard-sanitized-write permissions to the renderer to prevent Chromium from autonomously polling NSPasteboard
  • Eliminates clipboard contention that causes intermittent failures for concurrent CLI tools (e.g. Codex)

Test plan

  • Verify copy path actions work in editor tab context menu, line gutter context menu, and search results
  • Verify terminal copy (selection) still works
  • Verify terminal paste still works
  • Verify clipboard operations don't interfere with CLI tools running in terminal

🤖 Generated with Claude Code

…ard contention

Replaces all navigator.clipboard.writeText() calls with IPC-based
window.api.ui.writeClipboardText() and denies clipboard permissions to
the renderer, eliminating Chromium's NSPasteboard polling that causes
clipboard failures for concurrent CLI tools like Codex.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AmethystLiang AmethystLiang merged commit a0d8ba1 into main Mar 24, 2026
@AmethystLiang AmethystLiang deleted the AmethystLiang/fixPasteImage branch March 24, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant