Skip to content

Pasting images from WeChat screenshot clipboard fails on macOS #3136

@jialudev

Description

@jialudev

Problem

When copying a screenshot from WeChat (微信截图) and pressing Ctrl+V in Crush's chat editor, the image is not attached. Pasting a copied image file works fine.

Root cause

Crush reads clipboard images through github.com/aymanbagabas/go-nativeclipboard. On macOS, that library only reads NSPasteboardTypePNG:

// github.com/aymanbagabas/go-nativeclipboard/clipboard_darwin.go
case Image:
    pasteboardType = NSPasteboardTypePNG

WeChat screenshots are copied to the pasteboard as NSPasteboardTypeTIFF (or other bitmap representations), not PNG. Because the PNG type is absent, nativeclipboard.Image.Read() returns ErrUnavailable, and Crush falls back to reading text from the clipboard, which is empty or not a path.

Expected behavior

Crush should accept common clipboard image representations on macOS (PNG, TIFF, JPEG, etc.) and convert them to a supported image attachment format, similar to how other CLI tools like Codex handle screenshot paste.

Environment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions