prepare
fun prepare(selection: String, text: String, maxDecodedBytes: Int, maxWireBytes: Int): TerminalClipboardReply?
Java-friendly preparation from OSC 52 selector text. Unknown selectors return null; valid selectors are normalized before the typed preparation performs the text and byte-budget checks. No unchecked selector can enter a response.
Throws
if either byte budget is negative.
fun prepare(selection: TerminalClipboardSelection, text: String, maxDecodedBytes: Int, maxWireBytes: Int): TerminalClipboardReply?
Validates scalar UTF-16 and both byte budgets before allocating UTF-8 or Base64 storage. Null means malformed text or a size/overflow limit. Text is preserved exactly; paste policy and terminal modes do not apply.