Skip to main content

Module clipboard

Module clipboard 

Source
Expand description

Copying text to the system clipboard, and reading what the paste key inserts.

Port of copyToClipboard in packages/coding-agent/src/utils/clipboard.ts and of the reads of handleClipboardPaste in pi v1.0.0, without pi’s native clipboard addon: platform commands first, then OSC (operating system command) 52 for remote and headless sessions. On macOS a script reads the pasteboard as the addon does.

Enums§

Paste
What the paste key inserts.

Functions§

copy
Copies text. Terminal output (OSC 52) goes through emit.
paste
pi’s reads in handleClipboardPaste: the paths of copied files, else the clipboard’s image saved to a temporary file, else its text. The error is the reason pi reports.