Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Sources/Testing/EntryPoints/EntryPoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,9 @@ extension Event.ConsoleOutputRecorder.Options {
var result = Self()

result.useANSIEscapeCodes = _fileHandleSupportsANSIEscapeCodes(fileHandle)
if result.useANSIEscapeCodes {

// Respect the FORCE_COLOR environment variable. SEE: https://www.force-color.org
if result.useANSIEscapeCodes || Environment.variable(named: "FORCE_COLOR")?.isEmpty == false {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the intended interaction between FORCE_COLOR and NO_COLOR if both are specified?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NO_COLOR environment variable takes precedence.

if let noColor = Environment.variable(named: "NO_COLOR"), !noColor.isEmpty {
// Respect the NO_COLOR environment variable. SEE: https://www.no-color.org
result.ansiColorBitDepth = 1
Expand Down