module

Opal::Clipboard

Cross-platform system clipboard utility for terminal applications. Provides dual-layer clipboard copying:

  1. Terminal OSC 52 escape sequences for remote/SSH/multiplexed sessions.
  2. Native OS clipboard integration (Windows clip.exe, macOS pbcopy, Linux wl-copy/xclip).

Class methods

copy(text : String, io : IO = STDOUT, use_native : Bool = true, use_osc52 : Bool = true) : Bool

Copies text to the system clipboard. By default, both emits OSC 52 escape sequences to io and invokes the native OS clipboard utility.

Source
paste

Reads text from the host OS clipboard using platform-specific tools.

Source
supported?

Returns true if native OS clipboard tools or OSC 52 are available.

Source