anomalyco / anomalyco/opencode

macOS: image paste fails for Figma "Copy as PNG" clipboard contents

Open
#44,740 2 comments 0 reactions 1 assignee View on GitHub

@kommander is already working on this.

Since Aug 24, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

I tried to copy a design from Figma as PNG so I could paste in opencode and have the agent read the design.
Copying and pasting from other sites works fine, from Figma (specifically Desktop) is where pressint CMD+V or CTRL+V did nothing.

The agent generated the following notes to explain the issue, as it was able to fix it via some commands:

read() in packages/tui/src/clipboard.ts uses osascript -e 'set imageData to the clipboard as "PNGf"'. That coercion fails with -1700 ("Can't make some data into the expected type") when the clipboard comes from Figma's ⇧⌘C copy — even though a valid public.png is present.
Figma writes a type cocktail (org.w3.web-custom-format.*, public.png, Apple PNG pasteboard type, org.chromium.source-url, public.tiff) that breaks the AppleScript coercion. Rewriting the clipboard as plain PNG via NSPasteboard fixes pasting.
Suggested fix: on macOS read public.png directly (Swift helper or JXA ObjC bridge) instead of AppleScript coercion.

Plugins

No response

OpenCode version

1.18.8

Steps to reproduce
  1. Figma (web or desktop): select frame → ⇧⌘C (Copy as PNG)
  2. Paste into opencode TUI → nothing attaches
  3. osascript -e 'the clipboard as "PNGf"' → error -1700, while NSPasteboard.data(forType: .png) returns the PNG fine (verified via Swift)
Screenshot and/or share link

No response

Operating System

26.5.2 (25F84)

Terminal

Visual Studio Terminal

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.