Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/specs/mouse-and-clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ Paste reads the clipboard in three tiers, falling through in order:
2. **Plain text.** `navigator.clipboard.readText()`. If non-empty, the string is written to the PTY (with bracketed-paste wrapping when enabled by the inside program).
3. **Raw image data.** If neither of the above matches and the clipboard holds image bytes (e.g. a `Cmd+Shift+4` screenshot), the bytes are written to a newly-created private temp directory as `<uuid>.png` and that single path is pasted as in tier 1. On Unix-like systems the temp directory is owner-only and the image file is written owner-readable/writable to avoid exposing clipboard screenshots to other local users.

Each tier is implemented by a shared Node module (`standalone/sidecar/clipboard-ops.js`) that shells out to the OS-native clipboard tool: `osascript` on macOS, `Get-Clipboard` on Windows, `wl-paste`/`xclip` on Linux. The Tauri build reaches it through the existing sidecar; the VSCode build calls into the same module from its extension host. If every tier comes back empty, paste is a silent no-op.
Each tier is implemented by one of two backends. The **VSCode build** (all platforms) and the **standalone/Tauri build on macOS and Linux** use a shared Node module (`standalone/sidecar/clipboard-ops.js`) that shells out to the OS-native clipboard tool: `osascript` on macOS, `Get-Clipboard` on Windows, `wl-paste`/`xclip` on Linux — reached through the sidecar (Tauri) or the extension host (VSCode). The **standalone/Tauri build on Windows** instead reads the Win32 clipboard directly in Rust (`standalone/src-tauri/src/clipboard_win.rs`: `CF_HDROP` for file paths, `CF_UNICODETEXT` for text, `CF_DIB` for an image saved as a `.bmp` temp file — note the extension differs from the sidecar path's `.png`), because the sidecar's `Get-Clipboard` spawns a `powershell.exe` child that pops a console window on the windowless GUI process — several per paste. If every tier comes back empty, paste is a silent no-op.

Content-aware transformations, paste history, credential warnings, and middle-click (X11 PRIMARY) paste remain out of scope (see §9).

Expand Down
Loading