module
Opal::Clipboard
Overview
Cross-platform system clipboard utility for terminal applications. Provides dual-layer clipboard copying:
- Terminal OSC 52 escape sequences for remote/SSH/multiplexed sessions.
- Native OS clipboard integration (Windows
clip.exe, macOSpbcopy, Linuxwl-copy/xclip).
Defined in:
opal/clipboard.crClass Method Summary
-
.copy(text : String, io : IO = STDOUT, use_native : Bool = true, use_osc52 : Bool = true) : Bool
Copies text to the system clipboard.
-
.paste : String | Nil
Reads text from the host OS clipboard using platform-specific tools.
-
.supported? : Bool
Returns true if native OS clipboard tools or OSC 52 are available.
Class Method Detail
def self.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.
def self.paste : String | Nil
#
Reads text from the host OS clipboard using platform-specific tools.