MCPcopy
hub / github.com/deepnote/deepnote / shouldDisableColor

Function shouldDisableColor

packages/cli/src/output.ts:78–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76 * @see https://force-color.org/
77 */
78export function shouldDisableColor(): boolean {
79 // FORCE_COLOR takes precedence
80 if (process.env.FORCE_COLOR !== undefined) {
81 return process.env.FORCE_COLOR === '0'
82 }
83
84 // NO_COLOR standard: presence (any value) disables color
85 if (process.env.NO_COLOR !== undefined) {
86 return true
87 }
88
89 // Check if output is a TTY
90 if (!process.stdout.isTTY) {
91 return true
92 }
93
94 return false
95}
96
97/**
98 * Get a chalk instance configured for current output settings.

Callers 2

output.test.tsFile · 0.90
createProgramFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected