MCPcopy Create free account
hub / github.com/cli/cli / SetContentSanitization

Method SetContentSanitization

pkg/iostreams/iostreams.go:494–497  ·  view source on GitHub ↗

SetContentSanitization toggles ANSI escape sanitization on ContentOut. Commands should call this with false when an explicit opt-out flag (e.g. --allow-escape-sequences) is set, so subsequent writes of external content pass through unmodified.

(enabled bool)

Source from the content-addressed store, hash-verified

492// --allow-escape-sequences) is set, so subsequent writes of external content
493// pass through unmodified.
494func (s *IOStreams) SetContentSanitization(enabled bool) {
495 s.sanitizeContent = enabled
496 s.ContentOut = newContentWriter(s.Out, enabled)
497}
498
499// newContentWriter returns the writer to wire up as ContentOut. When
500// sanitize is true it inserts an asciisanitizer in front of the underlying

Callers 6

downloadRunFunction · 0.80
viewRunFunction · 0.80
readFileRunFunction · 0.80
apiRunFunction · 0.80
diffRunFunction · 0.80
LogsMethod · 0.80

Calls 1

newContentWriterFunction · 0.85

Tested by

no test coverage detected