Skip to content

fix(opencode): support macOS cmd+v image paste in tui#22197

Open
hernandezsanti wants to merge 1 commit intoanomalyco:devfrom
hernandezsanti:fix/FIX-22194-macos-cmd-v-image-paste
Open

fix(opencode): support macOS cmd+v image paste in tui#22197
hernandezsanti wants to merge 1 commit intoanomalyco:devfrom
hernandezsanti:fix/FIX-22194-macos-cmd-v-image-paste

Conversation

@hernandezsanti
Copy link
Copy Markdown

@hernandezsanti hernandezsanti commented Apr 12, 2026

Issue for this PR

Closes #22194

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

On macOS, clipboard image paste in the TUI only worked reliably through the existing input_paste path, so cmd+v could miss image attachments depending on the terminal.

This change adds a small probePaste() helper for macOS cmd+v, reuses one clipboard attachment path for both keydown and empty paste events, and avoids double-attaching when the key event and paste event happen back-to-back.

It works because image attachment now happens through the same code path whether the terminal reports paste as ctrl+v, meta/super+v, or an empty paste event.

How did you verify your code works?

  • bun test test/cli/cmd/tui/paste-key.test.ts
  • bun run typecheck
  • manual validation in Ghostty on macOS: copied an image to the clipboard, pressed cmd+v, and confirmed the image attached in the prompt

Screenshots / recordings

N/A for this bug fix.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Apr 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: macOS cmd+v image paste in TUI

1 participant