Skip to content

Pasting an image file copied in Finder attaches the file name or its icon instead of the image (macOS) #54844

Open

Description

@lacherogwu

Description

On macOS, copying an image file in Finder (Cmd+C) and pasting it into the TUI doesn't attach the image:

  • Cmd+V in terminals like VS Code's inserts only the file name (Screenshot … AM.png). Finder puts just the bare name on the pasteboard as text, and it doesn't resolve relative to the cwd.
  • Ctrl+V (prompt.paste) attaches Finder's generic 1024×1024 file icon, because OpenTUI reads the public.png flavor, which is the icon.

The real path is on the pasteboard as a file URL (public.file-url), but nothing reads it. Previously reported in #4004 and #7897 (both closed), and attempted in #6127 (auto-closed while stale).

OpenCode version

v2.0.25

Steps to reproduce

  1. Select an image in Finder, press Cmd+C
  2. Paste into the opencode prompt with Cmd+V or Ctrl+V
  3. You get the file name as text, or the Finder icon, instead of the image

Operating System

macOS 26 (Darwin 25.6)

Terminal

VS Code integrated terminal

Activity

  1. opencode-agent commented on Oct 12, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report, @lacherogwu. I couldn't reproduce this here because it needs macOS: the bug depends on what Finder puts on the macOS pasteboard when you copy a file, and the test environment runs Linux.

    The current dev code matches what you describe. prompt.paste asks the clipboard for image/png and then text/plain, and never asks for a file URL (public.file-url). So with a Finder file copy it can pick up the PNG icon, and Cmd+V through the terminal only gets the file name. A maintainer on macOS will need to confirm it.

    Related issues:

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

Metadata

Metadata

Assignees

No one assigned

    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