Skip to content

Commit

Permalink
Add support for NO_COLOR env var
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Nov 8, 2019
1 parent fb5bf9e commit c85ac54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CHANGELOG
* added the stamps of a message after it is dispatched in `TraceableMessageBus` and `MessengerDataCollector` collected data
* added `UuidCaster`
* made all casters final
* added support for the `NO_COLOR` env var (https://no-color.org/)

4.3.0
-----
Expand Down
5 changes: 5 additions & 0 deletions Dumper/CliDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,11 @@ private function hasColorSupport($stream): bool
return false;
}

// Follow https://no-color.org/
if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) {
return false;
}

if ('Hyper' === getenv('TERM_PROGRAM')) {
return true;
}
Expand Down

0 comments on commit c85ac54

Please sign in to comment.