cmux/Sources
Jose Masri b6163ccfad
Support pasting clipboard images in terminal (#562)
* Support pasting clipboard images as file paths in terminal

When the macOS clipboard contains only image data (e.g. from
Cmd+Ctrl+Shift+4 screenshot) and no text, Cmd+V now saves the image
as a temporary PNG file and pastes the file path into the terminal.
This allows CLI tools like Claude Code to receive pasted images.

The pasteboard heuristic only intercepts when there is image data
(TIFF/PNG) and no text/HTML/RTF, so normal text paste is unaffected.
Images over 10 MB are skipped and fall through to default behavior.

Closes #457

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix clipboard image paste: collision-free filenames and pasteAsPlainText validation

- Add UUID suffix to temp filenames to prevent overwrites when pasting
  images multiple times in the same second
- Only enable Paste menu (not Paste as Plain Text) for image-only clipboard,
  since pasteAsPlainText has no image-path handling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Shell-escape pasted image path before sending to terminal

Use escapeDropForShell on the clipboard image temp path, consistent
with how drag/drop paths are escaped, to avoid issues with
shell-special characters in the path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add docstrings to paste and validation functions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Jose Masri <ae_jmsalame@contractor.indeed.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com>
2026-03-02 18:00:00 -08:00
..
Find Break terminal find overlay retain cycle 2026-02-22 16:29:35 -08:00
Panels Add external URL bypass rules for embedded browser opens (#768) 2026-03-02 17:50:34 -08:00
Update Fix notification bell hover crash by conditionally tracking hover (#574) 2026-02-26 14:26:28 -08:00
AppDelegate.swift Fix Cmd+Tab activation ordering for cmux windows (#744) (#766) 2026-03-02 16:46:00 -08:00
Backport.swift Polish browser suggestions, focus, and tagged reload flow 2026-02-14 21:33:28 -08:00
BrowserWindowPortal.swift Fix double-click titlebar zoom not working on browser panel side 2026-02-24 14:35:10 -08:00
cmuxApp.swift Add external URL bypass rules for embedded browser opens (#768) 2026-03-02 17:50:34 -08:00
ContentView.swift Fix display-pass crash from isHidden toggle in debug hit test (#698) 2026-03-01 21:38:51 -08:00
GhosttyConfig.swift Honor Ghostty background-opacity across all cmux chrome (#667) 2026-03-01 03:48:46 -08:00
GhosttyTerminalView.swift Support pasting clipboard images in terminal (#562) 2026-03-02 18:00:00 -08:00
KeyboardLayout.swift Fix Cmd+plus zoom handling on non-US layouts (#680) 2026-02-28 00:16:03 -08:00
KeyboardShortcutSettings.swift Add Open Folder command (Cmd+O) (#656) 2026-02-27 16:28:18 -08:00
NotificationsPage.swift Adopt custom blue accent across active UI states 2026-02-24 14:22:58 -08:00
PortScanner.swift Avoid main-thread hops for explicit socket scope 2026-02-20 23:58:47 -08:00
PostHogAnalytics.swift Add telemetry opt-out setting (#610) 2026-02-26 22:02:29 -08:00
SentryHelper.swift Auto-heal missing CLI listener socket (#679) 2026-02-28 01:19:38 -08:00
SessionPersistence.swift Fix session restore routing and browser history persistence 2026-02-24 14:34:55 -08:00
SidebarSelectionState.swift Implement session persistence pass 1 with multi-window restore 2026-02-22 15:39:59 -08:00
SocketControlSettings.swift Fix Xcode Cloud UI tests by running TestAction in Debug (#672) 2026-02-28 01:48:49 -08:00
TabManager.swift Stabilize UI keyboard/focus regressions and flaky omnibar/sidebar tests (#689) 2026-02-28 07:09:37 -08:00
TerminalController.swift Add external URL bypass rules for embedded browser opens (#768) 2026-03-02 17:50:34 -08:00
TerminalNotificationStore.swift Optimize notification lookups with indexed store paths 2026-02-25 14:51:43 -08:00
TerminalView.swift Add sidebar blur effect with withinWindow blending (#9) 2026-02-04 03:04:45 -08:00
TerminalWindowPortal.swift Merge pull request #512 from manaflow-ai/fix/issue-483-terminal-portal-recovery 2026-02-25 18:12:39 -08:00
UITestRecorder.swift Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
WindowAccessor.swift Polish browser suggestions, focus, and tagged reload flow 2026-02-14 21:33:28 -08:00
WindowDecorationsController.swift Refine settings/about titlebar styling and controls alignment 2026-02-14 02:11:35 -08:00
WindowDragHandleView.swift Fix exclusive-access crash in WindowDragHandleView hitTest (#736) 2026-03-01 21:38:23 -08:00
WindowToolbarController.swift Coalesce title notification updates to reduce main-thread hangs 2026-02-20 20:14:19 -08:00
Workspace.swift Honor Ghostty background-opacity across all cmux chrome (#667) 2026-03-01 03:48:46 -08:00
WorkspaceContentView.swift Honor Ghostty background-opacity across all cmux chrome (#667) 2026-03-01 03:48:46 -08:00