clipboard

package
v0.0.310 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyImage

func CopyImage(imagePath string, imageData []byte) error

CopyImage copies image data to the system clipboard

func CopyText

func CopyText(text string) error

CopyText copies text to the system clipboard

func CopyTextOSC52 added in v0.0.112

func CopyTextOSC52(text string) error

CopyTextOSC52 writes an OSC 52 escape sequence directly to /dev/tty, instructing the terminal emulator to set the system clipboard. This works over SSH because the local terminal interprets the sequence. Writing to /dev/tty bypasses any stdout buffering or filtering by bubbletea.

func OSC52Sequence added in v0.0.112

func OSC52Sequence(text string) string

OSC52Sequence returns the OSC 52 escape sequence that instructs a terminal emulator to set the system clipboard to text. Uses the ST (ESC \) terminator. If running inside tmux or screen, wraps the sequence in a DCS passthrough so the outer terminal receives it.

func ReadImage

func ReadImage() ([]byte, error)

ReadImage reads image data from the system clipboard Returns the image data and an error if clipboard doesn't contain an image

func ReadPrimarySelection added in v0.0.62

func ReadPrimarySelection() (string, error)

ReadPrimarySelection reads from the PRIMARY selection (middle-click buffer on Linux). On macOS, falls back to the regular clipboard since there's no primary selection.

func ReadText

func ReadText() (string, error)

ReadText reads text content from the system clipboard

Types

This section is empty.

Jump to

Keyboard shortcuts

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