[PR #4198] fix: paste in-mem img #10893

Closed
opened 2026-02-16 18:15:39 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/4198

State: closed
Merged: No


Fix clipboard image paste and file path display issue

Fixes in-memory screenshot pasting and prevents file paths from appearing in chat when pasting image files.

Changes:

  • Replace command trigger with direct Clipboard.read() call when pasting with empty text
  • Call event.preventDefault() synchronously before async operations to prevent text insertion race condition
  • Simplify image file path detection logic

Result:

  • Screenshots from clipboard now paste correctly showing only [Image N]
  • Image file paths no longer appear as text alongside the image placeholder

Fixes #4077

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/4198 **State:** closed **Merged:** No --- ## Fix clipboard image paste and file path display issue Fixes in-memory screenshot pasting and prevents file paths from appearing in chat when pasting image files. ### Changes: - Replace command trigger with direct `Clipboard.read()` call when pasting with empty text - Call `event.preventDefault()` synchronously before async operations to prevent text insertion race condition - Simplify image file path detection logic ### Result: - Screenshots from clipboard now paste correctly showing only [Image N] - Image file paths no longer appear as text alongside the image placeholder Fixes #4077
yindo added the pull-request label 2026-02-16 18:15:39 -05:00
yindo closed this issue 2026-02-16 18:15:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10893