Clipboard images not pasted into prompt when running inside tmux

Resolved 💬 1 comment Opened Feb 14, 2026 by FlourishingHumanityCorporation Closed Feb 14, 2026

Bug Description

When running Claude Code inside a tmux session, pasting a clipboard image (e.g., via Cmd+V on macOS) does not deliver the image to the Claude Code input. The paste appears to do nothing — no image attachment appears in the prompt.

Outside of tmux (direct terminal), clipboard image paste works as expected.

Environment

  • Claude Code version: 2.1.42
  • OS: macOS 26.2 (Tahoe), arm64 (Apple Silicon)
  • Terminal: tmux 3.x (inside an outer terminal — likely iTerm2 or Terminal.app)
  • Shell: zsh

Steps to Reproduce

  1. Copy an image to the macOS clipboard (e.g., screenshot via Cmd+Shift+4, or copy from Preview/browser)
  2. Open a tmux session: tmux
  3. Run claude inside the tmux pane
  4. Attempt to paste the image with Cmd+V
  5. Expected: Image appears as an attachment in the Claude Code prompt
  6. Actual: Nothing happens — no image is attached

Expected Behavior

Clipboard images should be pasted into the Claude Code prompt regardless of whether the session is inside tmux or not, the same way they work in a bare terminal.

Likely Root Cause

tmux intercepts the paste operation and only forwards text content from the clipboard — it does not forward binary/image data from the system pasteboard. Claude Code likely reads image data from the system clipboard via OSC 52 sequences or a platform-specific API (e.g., pbpaste on macOS), but tmux may be stripping or blocking the image MIME type.

Recommended Solution

Instead of relying on terminal paste passthrough for images, Claude Code could read the system clipboard directly when it detects an image paste attempt:

  1. macOS: Use osascript or NSPasteboard via a helper to check if the clipboard contains image data (public.png, public.tiff), and if so, read it directly — bypassing the terminal's paste buffer entirely.
  2. Linux: Use xclip -selection clipboard -t image/png -o or wl-paste --type image/png.
  3. Fallback: If the terminal does pass through image data (e.g., iTerm2's native image paste), continue using the existing path.

This would make image paste work in tmux, screen, and any other terminal multiplexer that strips non-text clipboard content.

Alternative / Simpler Workaround

Expose a /paste-image command or keybinding that explicitly reads image data from the system clipboard (via pbpaste or platform equivalent), rather than relying on terminal paste events. This would be a reliable cross-terminal solution.

Workaround (Current)

Run Claude Code outside of tmux when image paste is needed, or save the image to a file and reference it explicitly.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗