Documentation
¶
Overview ¶
Package clip writes text to the system clipboard.
Two strategies, tried in this order unless overridden by PE_CLIP:
A native helper, if one is on PATH: macOS pbcopy Linux/Wayland wl-copy Linux/X11 xclip / xsel WSL clip.exe (after the above fail) Windows clip
OSC 52 escape sequence written to /dev/tty. Carries the clipboard payload through the terminal emulator (and through tmux/SSH on the way), so it works on a headless remote box as long as the local terminal — WezTerm, iTerm2, kitty, Alacritty, modern xterm, Windows Terminal, etc. — opts into OSC 52.
PE_CLIP overrides the strategy:
PE_CLIP=native use a native helper, fail if absent PE_CLIP=osc52 skip native, always emit OSC 52 PE_CLIP=none no-op (useful for testing pe itself) (unset) auto: native first, OSC 52 fallback
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoBackend = errors.New("no clipboard backend found")
ErrNoBackend is returned when no supported clipboard backend can be used.
Functions ¶
Types ¶
This section is empty.