Documentation
¶
Overview ¶
Package terminalcontrol takes the terminal's controls out of stored or remote text, so that text cannot drive the terminal it is drawn on. OSC 52 in such text sets the clipboard, and CSI moves the cursor to hide lines on the screen or fake them. A program strips where it prints the text and keeps the stored value as written, as an HTML template escapes at render time. The package imports nothing that draws, so a command that only prints pays for no board.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Strip ¶
Strip is text without its terminal controls. ESC opens a sequence, and the whole sequence leaves: CSI, OSC, DCS, SOS, PM, APC, or ESC with the bytes it takes. Every C0 and C1 control leaves too, and so does DEL. A C1 control leaves alone, as a code point or a byte outside any character, so the text after it stays. Text decoded in the wrong charset carries C1 code points, and a quote that turned into U+009D must not take the rest of a title with it. A newline and a tab stay, and each ends a sequence it falls inside, so the text keeps its lines however it is split. Text holding no control comes back as it was, with nothing allocated.
Types ¶
This section is empty.