diff --git a/src/Printers/Console.php b/src/Printers/Console.php index 6b52c3b..45f9147 100644 --- a/src/Printers/Console.php +++ b/src/Printers/Console.php @@ -105,8 +105,8 @@ protected function colorize(string $s, ?string $color): string */ protected function detectColorSupport(): bool { - return (function_exists('posix_isatty') && posix_isatty(STDOUT)) + return defined('STDOUT') && ((function_exists('posix_isatty') && posix_isatty(STDOUT)) || (function_exists('stream_isatty') && stream_isatty(STDOUT)) - || (function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(STDOUT)); + || (function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(STDOUT))); } }