Documentation
¶
Overview ¶
Package copyable finds the text a block's output offers to copy.
A program can offer text for the clipboard two ways. iTerm2's OSC 1337 CopyToClipboard and EndCopy bracket text it prints: what comes between them is shown as usual and is also the text to copy. OSC 52 carries the text in the sequence, base64 encoded, and nothing is shown. A terminal writes the clipboard on either. mdsh never writes the clipboard from output, which is saved in the file and run again by whoever opens it, so it offers each such text with a copy button, or a key in the TUI, instead.
Index ¶
Constants ¶
const MaxText = 1 << 20
MaxText caps the text one OSC 52 sequence can offer, as a guard against output made to be huge.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Part ¶
type Part struct {
Kind Kind
// Text is the output, for Plain, and the text offered, for Hidden.
Text string
// N numbers the copyable texts in the output from 1, for Open,
// Close and Hidden.
N int
}
A Part is a piece of output: text as it was printed, escapes and all, or a sequence that starts or ends a copyable region or offers text.