module

Opal::Terminal::OSC

Operating System Command (OSC) escape sequences for modern terminal emulators.

Class methods

clipboard_copy(text : String, target : Char = 'c') : String

Generates an OSC 52 clipboard copy escape sequence using strict Base64 encoding. Allows copying text directly into the host OS clipboard over SSH and local terminal sessions. clipboard target: 'c' = primary clipboard, 'p' = selection clipboard

Source
copy_to_clipboard(text : String, io : IO = STDOUT, target : Char = 'c') : Nil

Directly copies text to the system clipboard via STDOUT using OSC 52.

Source