Skip to content

Commit c85ac54

Browse files
committed
Add support for NO_COLOR env var
1 parent fb5bf9e commit c85ac54

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CHANGELOG
1010
* added the stamps of a message after it is dispatched in `TraceableMessageBus` and `MessengerDataCollector` collected data
1111
* added `UuidCaster`
1212
* made all casters final
13+
* added support for the `NO_COLOR` env var (https://no-color.org/)
1314

1415
4.3.0
1516
-----

Dumper/CliDumper.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,11 @@ private function hasColorSupport($stream): bool
582582
return false;
583583
}
584584

585+
// Follow https://no-color.org/
586+
if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) {
587+
return false;
588+
}
589+
585590
if ('Hyper' === getenv('TERM_PROGRAM')) {
586591
return true;
587592
}

0 commit comments

Comments
 (0)