Skip to content

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

Closed as not planned

Description

@omar-guillermo-qp

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

Activity

  1. github-actions commented on Aug 24, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is specifically about Figma's multi-type clipboard format breaking the osascript coercion (which yours appears to be), it may be a distinct root cause worth tracking separately, but please check the above issues to see if a fix there would also address your case.

  2. disarticulate commented on Sep 12, 2026

    @disarticulate

    copy paste doesnt work anywhere because who ever decided to override normal terminal behavior fails to read issues.

  3. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions