claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Text from OneNote (any rich text editor) is converted into [Image #1]

Open percyvega opened this issue 4 months ago • 4 comments

Environment

  • Platform (select one):
    • [x] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 1.0.98 (Claude Code)
  • Operating System: macOS 15.6.1 (24G90)
  • Terminal: iTerm2

Bug Description

When I copy text from OneNote, and paste it into the iTerm2 Claude CLI version specified above, the text I pasted is shown correctly, but almost instantly it is converted into an image. It should stay as text and not converted into an image.

Steps to Reproduce

  1. Open OneNote or any other rich text editor.
  2. Select any text and copy it (which goes into the clipboard).
  3. Paste it into the iTerm2 Claude CLI and see how the text is transformed into an image.

Expected Behavior

Leave it as text.

Actual Behavior

It got converted into an image.

Additional Context

percyvega avatar Aug 30 '25 19:08 percyvega

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/5051
  2. https://github.com/anthropics/claude-code/issues/5496
  3. https://github.com/anthropics/claude-code/issues/4705

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Aug 30 '25 20:08 github-actions[bot]

This is not a duplicate of any of those 3 issues.

percyvega avatar Aug 30 '25 20:08 percyvega

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 05 '25 10:12 github-actions[bot]

Still reproducible on macOS Sequoia (Darwin 24.6.0) with Claude Code CLI.

Additional reproduction case: Copy a file from Finder (Cmd+C), paste into Claude Code. Only the file icon image appears; the filename text and file-url are lost.

Technical analysis: macOS clipboard contains multiple formats simultaneously:

  • public.file-url → full file path
  • public.utf8-plain-text → filename only
  • public.tiff / com.apple.icns → file icon image

Claude Code appears to prioritize image formats over text formats when both are present.

Suggested fix: When clipboard contains public.file-url, extract the path as text rather than using the image representation.

tobez avatar Dec 07 '25 16:12 tobez