MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / ansiColorsEnabled

Function ansiColorsEnabled

src/ui/color.ts:20–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 * both honor NO_COLOR, --no-color/--color, FORCE_COLOR, TTY, and CI.
19 */
20export function ansiColorsEnabled(): boolean {
21 if (process.argv.includes('--no-color')) return false;
22 if (process.argv.includes('--color')) return true;
23
24 const noColor = process.env.NO_COLOR;
25 if (noColor !== undefined && noColor !== '') return false;
26
27 const forceColor = process.env.FORCE_COLOR;
28 if (forceColor !== undefined && forceColor !== '') {
29 return forceColor !== '0' && forceColor.toLowerCase() !== 'false';
30 }
31
32 if (process.stdout.isTTY === true && process.env.TERM !== 'dumb') return true;
33
34 const ci = process.env.CI;
35 if (ci !== undefined && ci !== '') return true;
36
37 return false;
38}

Callers 3

createShimmerProgressFunction · 0.90
index.tsFile · 0.90
codegraph.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected