clipboard

package
v1.55.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoImage = errors.New("clipboard: no image")

ErrNoImage is returned by ReadImage when the clipboard does not contain an image in a supported format. Callers typically fall back to text.

Functions

func Read

func Read() (string, error)

Read returns the current system clipboard text content. Platform-specific implementations are in clipboard_windows.go and clipboard_unix.go.

func ReadImage added in v1.3.0

func ReadImage() ([]byte, error)

ReadImage returns the current clipboard image encoded as PNG bytes. If the clipboard does not contain an image in a supported format, it returns ErrNoImage. On platforms where image clipboard is not implemented, it also returns ErrNoImage.

This exists primarily to work around the Windows-specific upstream bug in claude-code where its own clipboard image reader fails to see images that are verifiably present on the clipboard (see anthropics/claude-code#32791). Quil reads the image itself, saves a temp file, and pastes the path so any PTY tool can pick it up via its file-reading tools.

func Write

func Write(text string) error

Write sets the system clipboard to the given text. Platform-specific implementations are in clipboard_windows.go and clipboard_unix.go.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL