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

Function detectColor

internal/ui/ui.go:37–49  ·  view source on GitHub ↗
(w io.Writer)

Source from the content-addressed store, hash-verified

35}
36
37func detectColor(w io.Writer) bool {
38 if os.Getenv("NO_COLOR") != "" {
39 return false
40 }
41 if term := os.Getenv("TERM"); term == "dumb" {
42 return false
43 }
44 file, ok := w.(*os.File)
45 if !ok {
46 return false
47 }
48 return isatty.IsTerminal(file.Fd()) || isatty.IsCygwinTerminal(file.Fd())
49}
50
51func (p *Printer) sprint(c *color.Color, msg string) string {
52 if !p.Color {

Callers 1

NewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected