From e09313c63aa8f23ed6125ba93c11a8a4b85afd88 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 11 Nov 2024 09:39:18 +0100 Subject: [PATCH] Fix "Argument #1 ($string) must be of type string, bool given" --- src/Console/Terminal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Console/Terminal.php b/src/Console/Terminal.php index 8b585bf3..1e438135 100644 --- a/src/Console/Terminal.php +++ b/src/Console/Terminal.php @@ -54,7 +54,7 @@ private static function initDimensions(): void { $consoleMode = self::getConsoleMode(); - if ('\\' === \DIRECTORY_SEPARATOR) { + if ('\\' === \DIRECTORY_SEPARATOR && is_string(\getenv('ANSICON'))) { if (\preg_match('#^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$#', \trim(\getenv('ANSICON')), $matches)) { self::$width = (int) $matches[1]; } elseif (! self::hasVt100Support() && self::hasSttyAvailable()) {