claude-code - 💡(How to fix) Fix iTerm2: image drag-and-drop pastes file path instead of attaching after clearing buffer (Cmd+R)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Dragging an image file into the terminal attaches it correctly as an image. After clearing the iTerm2 buffer with Cmd+R (iTerm2's "Clear Buffer"), drag-and-drop stops being intercepted by Claude Code — instead of attaching the image, it inserts the file's local path as plain text (iTerm2's native drop behavior).

Root Cause

Dragging an image file into the terminal attaches it correctly as an image. After clearing the iTerm2 buffer with Cmd+R (iTerm2's "Clear Buffer"), drag-and-drop stops being intercepted by Claude Code — instead of attaching the image, it inserts the file's local path as plain text (iTerm2's native drop behavior).

Fix Action

Workaround

  • Copy the image to the clipboard and paste with Cmd+V instead of dragging.
  • Restart Claude Code to restore drag-and-drop attachment.
  • Use Ctrl+L (redraw) instead of Cmd+R to clear the view without triggering the regression.
RAW_BUFFERClick to expand / collapse

Summary

Dragging an image file into the terminal attaches it correctly as an image. After clearing the iTerm2 buffer with Cmd+R (iTerm2's "Clear Buffer"), drag-and-drop stops being intercepted by Claude Code — instead of attaching the image, it inserts the file's local path as plain text (iTerm2's native drop behavior).

Steps to reproduce

  1. Start claude in iTerm2.
  2. Drag an image file from Finder into the prompt → ✅ it is attached as an image ([Image #N] chip).
  3. Press Cmd+R (iTerm2 → Clear Buffer).
  4. Drag the same image file into the prompt again.

Expected behavior

The dropped image is attached as an image, the same as before clearing the buffer.

Actual behavior

The local file path of the image is pasted as plain text instead of the image being attached. This persists until Claude Code is restarted.

Workaround

  • Copy the image to the clipboard and paste with Cmd+V instead of dragging.
  • Restart Claude Code to restore drag-and-drop attachment.
  • Use Ctrl+L (redraw) instead of Cmd+R to clear the view without triggering the regression.

Environment

  • Claude Code: 2.1.150
  • Terminal: iTerm2 3.6.10
  • macOS: 26.5 (build 25F71)

Notes

Cmd+R is iTerm2's "Clear Buffer" command, not a Claude Code keybinding — so the buffer clear is happening at the terminal-emulator level, after which Claude Code's image-drop interception appears to be lost and iTerm2's default file-path drop behavior takes over.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The dropped image is attached as an image, the same as before clearing the buffer.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING