Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MultiWriter ¶
type MultiWriter struct {
// contains filtered or unexported fields
}
MultiWriter is a concurrent safe writer that allows appending/removing writers. Newly appended writers get the last write to preserve last output.
func NewMultiWriter ¶
func NewMultiWriter(bufferSize int, writers ...io.Writer) *MultiWriter
func (*MultiWriter) Remove ¶
func (t *MultiWriter) Remove(writers ...io.Writer)
type TerminalQueryFilter ¶ added in v0.21.0
type TerminalQueryFilter struct {
// contains filtered or unexported fields
}
TerminalQueryFilter wraps an io.Writer and filters out terminal query sequences from the output. This prevents queries sent by the host's shell from reaching connected clients, whose terminals would otherwise respond and pollute the PTY input.
Filtered queries include:
- OSC 10/11/12 queries (foreground/background/cursor color): ESC ] N ; ? BEL/ST
- CSI 5 n (device status request)
- CSI 6 n (cursor position request)
- CSI c / CSI 0 c (primary device attributes)
- CSI > c / CSI > 0 c (secondary device attributes)
- CSI = c / CSI = 0 c (tertiary device attributes)
func NewTerminalQueryFilter ¶ added in v0.21.0
func NewTerminalQueryFilter(w io.Writer) *TerminalQueryFilter
NewTerminalQueryFilter creates a filter that removes terminal query sequences from output before writing to the underlying writer.
func (*TerminalQueryFilter) Write ¶ added in v0.21.0
func (f *TerminalQueryFilter) Write(p []byte) (int, error)
Write filters terminal query sequences from p and writes the result to the underlying writer. Returns len(p) on success to indicate all input bytes were processed. On error, returns 0 because the filtered output is written atomically (all or nothing) and input bytes don't map 1:1 to output bytes due to filtering.