MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / New

Function New

internal/ui/ui.go:27–35  ·  view source on GitHub ↗

New constructs a Printer whose Color flag follows the standard auto-detect rules. nil writers fall back to os.Stdout / os.Stderr.

(out, err io.Writer)

Source from the content-addressed store, hash-verified

25// New constructs a Printer whose Color flag follows the standard auto-detect
26// rules. nil writers fall back to os.Stdout / os.Stderr.
27func New(out, err io.Writer) *Printer {
28 if out == nil {
29 out = os.Stdout
30 }
31 if err == nil {
32 err = os.Stderr
33 }
34 return &Printer{Out: out, Err: err, Color: detectColor(out)}
35}
36
37func detectColor(w io.Writer) bool {
38 if os.Getenv("NO_COLOR") != "" {

Calls 1

detectColorFunction · 0.85