module Opal::Terminal::OSC

Overview

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

Defined in:

opal/terminal/osc.cr

Class Method Summary

Class Method Detail

def self.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


[View source]
def self.copy_to_clipboard(text : String, io : IO = STDOUT, target : Char = 'c') : Nil #

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


[View source]
def self.hyperlink(text : String, url : String, id : String | Nil = nil) : String #

Generates an OSC 8 clickable hyperlink escape sequence. Supported by Windows Terminal, iTerm2, Kitty, WezTerm, Alacritty, GNOME Terminal, etc.


[View source]