Documentation
¶
Overview ¶
Package osc7501 parses the OSC 7501 "program status" terminal protocol (rev 0.4, https://www.superlogical.com/rex/docs/build/program-status).
A report has the form ESC ] 7501 ; key=value:key=value ST where ST is ESC \ or BEL. Parse decodes a report body, Report.Encode produces a canonical sequence, and Scanner is an io.Writer filter that recognises reports in a byte stream while forwarding every byte unchanged.
Known limitation: Scanner tracks only OSC framing, so an ESC ] that appears inside a DCS or APC string can be mis-framed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Report ¶
type Report struct {
State, ID, Kind, App, Title, Msg string // Title and Msg are decoded
Progress int // 0-100, or -1 if indeterminate
}
Report is a decoded program status report.
type Scanner ¶
type Scanner struct {
W io.Writer // downstream; receives all bytes unchanged
OnReport func(Report)
OnQuery func()
// contains filtered or unexported fields
}
Scanner is an io.Writer that forwards every byte to W unchanged while recognising OSC 7501 reports and queries. Sequences may be split across Write calls at any byte. Callbacks run after all bytes up to and including the sequence terminator have been written to W.