Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Active ¶
func Active() bool
Active reports whether terminal replies should currently be discarded.
func QuarantineFor ¶
QuarantineFor drops terminal reply traffic until the later of the existing deadline or now+duration.
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter strips terminal-generated control replies from a byte stream while preserving ordinary keyboard input. It is stateful so replies split across reads are discarded without relying on terminal-specific payload strings.
func (*Filter) Active ¶
Active reports whether the filter is carrying parser state across read boundaries.
func (*Filter) Consume ¶
Consume filters a chunk of bytes. When armed is true, terminal-generated control replies are discarded. If a reply started in a previous chunk, it continues to be discarded until it terminates even if armed is now false.
Terminal replies covered here:
- escape-string families: OSC, DCS, APC, PM, SOS
- CSI replies during the quarantine window, except for a small whitelist of keyboard-related CSI finals (arrows/home/end/backtab/~ keys/kitty CSI u)
If final is true, any incomplete pending escape/CSI/SS3 sequence is flushed as literal input, while an incomplete discarded escape-string reply is dropped.