GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(tui): make Windows image paste reliable by LoserFox · Pull Request #13161 · anomalyco/opencode

Conversation

@LoserFox

@LoserFox LoserFox commented Feb 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

What does this PR do?

This fixes slow/unstable image paste behavior in the TUI on Windows. (Fixes #12547)

Context:

  • On my machine, screenshot paste in the TUI was inconsistent and often very slow.

Changes:

  1. packages/opencode/src/cli/cmd/tui/util/clipboard.ts

    • Reworked Windows image read path to:
      • save clipboard image to a temp PNG,
      • read it with Bun,
      • clean up locally with rmSync.
    • Added in-flight reuse for concurrent reads so repeated triggers don't spawn duplicate work.
  2. packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

    • Unified image paste handling via tryPasteClipboardImage(...).
    • On Windows, image probing is now applied consistently for:
      • paste key handling (Ctrl+V / Shift+Insert path),
      • onPaste flow before falling back to text.
    • Added a render refresh after image insertion to make the placeholder update reliable.

Why this works:

  • The temp-file path avoids fragile stdout/base64 transport from PowerShell.
  • Prompt-side flow now consistently prefers real clipboard image data over ambiguous pasted text payloads.

How did you verify your code works?

  • Verification on Windows:
    • Press screenshot key on your keyboard, Then copy it, Paste it in the TUI.
    • Screenshot clipboard image paste now goes through the same image path and inserts image parts in prompt

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@LoserFox
fix(tui): make Windows image paste reliable
575e1a5
@github-actions github-actions Bot added the needs:issue label Feb 11, 2026
@github-actions

github-actions Bot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Related PRs Found

The following PRs are potentially related to this Windows image paste fix:

  1. fix(tui): support clipboard image paste with proper filename on WSL2 #8209 - fix(tui): support clipboard image paste with proper filename on WSL2

    • Addresses clipboard image paste issues on WSL2/Windows, likely predecessor work on this feature
  2. fix(tui): fix Ctrl+V paste on Windows/WSL2 (#6560 and #8209) #8626 - fix(tui): fix Ctrl+V paste on Windows/WSL2

    • Directly references fixing Ctrl+V paste on Windows/WSL2, overlapping functionality
  3. fix(desktop): windows clipboard images come thru as data not file #12549 - fix(desktop): windows clipboard images come thru as data not file

    • Related to Windows clipboard image handling and format issues
  4. feat: auto-compress clipboard images to avoid API size limits #6455 - feat: auto-compress clipboard images to avoid API size limits

    • Related clipboard image processing work

These PRs appear to be part of an ongoing effort to improve clipboard image paste handling on Windows. PR #13161 may represent a refinement or completion of work started in earlier PRs like #8209 and #8626.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed the needs:issue label Feb 11, 2026
@LoserFox

LoserFox commented Feb 11, 2026

Copy link
Copy Markdown
Author

Perhaps it duplicates #12592, as both are aimed at fixing the same issue. However, I implemented it from the TUI side, while he fixed it from the server side. I believe the two PRs do not conflict with each other, but if the goal is simply to fix this issue, merging either one would suffice.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Feb 16, 2026
fix: Ctrl+V paste not working on Windows 11 TUI #13798
Closed
fix: handle text clipboard paste on Ctrl+V for Windows terminals #13871
Closed
@pirrozani pirrozani mentioned this pull request Mar 15, 2026
fix(tui): add Alt+V as fallback keybind for image paste on Windows Terminal #17539
Closed
3 tasks done
@LoserFox

LoserFox commented Mar 16, 2026

Copy link
Copy Markdown
Author

Hi @rekram1-node Just a gentle ping on this PR. Let me know if you have time to take a look, or if there's anything else need.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Mar 20, 2026
fix(bug) paste image #18361
Closed
2 of 6 tasks
@Mr-chen-05

Mr-chen-05 commented Apr 5, 2026

Copy link
Copy Markdown

Hi, just wanted to add a +1 here. I'm hitting this exact issue on Windows — Snipaste / Win+Shift+S screenshots can't be pasted via Ctrl+V in the TUI at all (related: #13322).

The temp-file approach in this PR looks like the right fix. Any chance this can get a review pass and merged? The DIRTY state suggests a rebase is needed — happy to see it land soon.

Thanks for the work on this!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@opencode-agent
opencode-agent Bot force-pushed the dev branch from 2f2ed11 to 9f201d6 Compare April 16, 2026 21:55
@rekram1-node

rekram1-node commented May 15, 2026

Copy link
Copy Markdown
Member

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node rekram1-node closed this May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Crash on Windows when pasting images from clipboard (ERR_INVALID_URL_SCHEME)

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@LoserFox @Mr-chen-05 @rekram1-node
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.