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(desktop): add native clipboard image paste and fix text paste by invarrow · Pull Request #12682 · anomalyco/opencode

Conversation

@invarrow

@invarrow invarrow commented Feb 8, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Summary

  • Add native clipboard image paste support for the desktop app using Tauri's clipboard-manager plugin
  • Fix a bug where text paste was broken because the native clipboard image check ran before checking for text

Problem

Fixes #9868 #12686

When pasting text on the desktop app, the handlePaste function was checking for native clipboard images (via platform.readClipboardImage) before checking if there was text on the clipboard. Since OS clipboards can hold multiple formats simultaneously, this caused stale image data to be returned even when the user copied text, resulting in:

  1. Text paste being skipped entirely
  2. An old/stale image being pasted instead

Solution

Reordered the paste logic so that:

  1. Browser-detected images are handled first
  2. Unsupported file types show a toast
  3. Plain text is extracted from clipboard
  4. Only if there's no text, the native Tauri clipboard is checked for images (e.g., screenshots copied outside the browser)
  5. Text is inserted if present

Changes

  • packages/app/src/components/prompt-input.tsx: Fixed paste order logic
  • packages/app/src/context/platform.tsx: Added readClipboardImage to Platform type
  • packages/desktop/src/index.tsx: Implemented readClipboardImage using Tauri plugin
  • packages/desktop/package.json: Added @tauri-apps/plugin-clipboard-manager dependency
  • packages/desktop/src-tauri/capabilities/default.json: Added clipboard-manager:allow-read-image capability

Sorry, something went wrong.

Uh oh!

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

All reactions
@invarrow
invarrow requested a review from adamdotdevin as a code owner February 8, 2026 10:54
@github-actions github-actions Bot added the needs:issue label Feb 8, 2026
@github-actions

github-actions Bot commented Feb 8, 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 8, 2026

Copy link
Copy Markdown
Contributor

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

Potential Related PRs Found

Based on the search results, here are PRs that appear related to clipboard and paste handling:

  1. feat: Pass through data URLs directly and gracefully handle unknown U… #12592 - feat: Pass through data URLs directly and gracefully handle unknown URLs

    • Related to clipboard image handling and data URL processing
  2. fix(desktop): windows clipboard images come thru as data not file #12549 - fix(desktop): windows clipboard images come thru as data not file

    • Directly related to desktop clipboard image handling, appears to be a similar issue
  3. fix: support reading furl (file URL) from macOS clipboard #6127 - fix: support reading furl (file URL) from macOS clipboard

    • Related to native clipboard image support on macOS
  4. fix(tui): support clipboard image paste with proper filename on WSL2 #8209 - fix(tui): support clipboard image paste with proper filename on WSL2

    • Related to clipboard image paste functionality (though for TUI, not desktop)

The most closely related PR is #12549, which also addresses desktop clipboard image issues and may be addressing a related or overlapping problem.

All reactions

Sorry, something went wrong.

Uh oh!

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

@invarrow
fix(desktop): add native clipboard image paste and fix text paste
fa1f87c
- Add @tauri-apps/plugin-clipboard-manager for native clipboard access
- Add readClipboardImage platform method to read images via Tauri
- Add clipboard-manager:allow-read-image capability
- Fix handlePaste to check for text before trying native clipboard image

The native clipboard fallback was running before checking for plain text,
causing stale image data to override text paste. Now the fallback only
runs when there's no text on the clipboard.
@github-actions github-actions Bot removed the needs:issue label Feb 8, 2026
@invarrow

invarrow commented Feb 8, 2026

Copy link
Copy Markdown
Contributor Author

Fixes #9868 #12686

All reactions

Sorry, something went wrong.

Uh oh!

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

@invarrow
invarrow force-pushed the fix/desktop-clipboard-paste branch from 29e1fd1 to fa1f87c Compare February 8, 2026 11:19
@adamdotdevin
adamdotdevin enabled auto-merge (squash) February 8, 2026 11:23
adamdotdevin
adamdotdevin approved these changes Feb 8, 2026
View reviewed changes
@adamdotdevin
adamdotdevin merged commit d5036cf into anomalyco:dev Feb 8, 2026
6 checks passed

Uh oh!

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

Colin4k1024 pushed a commit to Colin4k1024/opencode that referenced this pull request Feb 10, 2026
@invarrow @Colin4k1024
fix(desktop): add native clipboard image paste and fix text paste (an…
7bc022c
…omalyco#12682)
BryceRyan pushed a commit to BryceRyan/opencode that referenced this pull request Feb 10, 2026
@invarrow @BryceRyan
fix(desktop): add native clipboard image paste and fix text paste (an…
7238987
…omalyco#12682)
@adolago adolago mentioned this pull request Feb 14, 2026
[Opencode Sync] Desktop: Frontend Shell adolago/zee#321
Closed
3 tasks
relaxkeren pushed a commit to relaxkeren/opencode that referenced this pull request Feb 15, 2026
@invarrow @keren-mxr
fix(desktop): add native clipboard image paste and fix text paste (an…
4a58123
…omalyco#12682)
schneiderlo pushed a commit to schneiderlo/opencode that referenced this pull request Feb 17, 2026
@invarrow @schneiderlo
fix(desktop): add native clipboard image paste and fix text paste (an…
a0b54a5
…omalyco#12682)
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
@invarrow
fix(desktop): add native clipboard image paste and fix text paste (an…
9d3c130
…omalyco#12682)
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
@invarrow
fix(desktop): add native clipboard image paste and fix text paste (an…
b1b6744
…omalyco#12682)
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
@invarrow
fix(desktop): add native clipboard image paste and fix text paste (an…
ac85b14
…omalyco#12682)
MarsQiu007 referenced this pull request in MarsQiu007/openNovel Jul 31, 2026
@invarrow
fix(desktop): add native clipboard image paste and fix text paste (#1…
444312f
…2682)
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
@invarrow
fix(desktop): add native clipboard image paste and fix text paste (an…
c7fc447
…omalyco#12682)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adamdotdevin adamdotdevin adamdotdevin approved these changes

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.

ubuntu 25.10 cant paste image on desktop app

Uh oh!

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

2 participants

@invarrow @adamdotdevin
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.