setClipboard static method
Set the terminal clipboard via OSC 52.
Most terminals expect base64-encoded UTF-8.
This requires ANSI escape support and may be blocked by terminal security settings. It is safe to call even if unsupported.
Implementation
static Cmd setClipboard(String text, {String selection = 'c'}) {
final sel = selection.isEmpty ? 'c' : selection[0];
final payload = base64.encode(utf8.encode(text));
return writeRaw('\x1b]52;$sel;$payload\x07');
}