diff --git a/src/Console.php b/src/Console.php index 8e873d6..066cca0 100644 --- a/src/Console.php +++ b/src/Console.php @@ -114,7 +114,10 @@ public function __construct(?int $wrap = 80, int|string|null $margin = 4) if (function_exists('exec') && stream_isatty(STDERR)) { if (!empty(exec('which stty'))) { - [$height, $width] = explode(' ', exec('stty size'), 2); + $sttySize = exec('stty size'); + if (!empty($sttySize) && str_contains($sttySize, ' ')) { + [$height, $width] = explode(' ', $sttySize, 2); + } } else if (!empty(exec('which tput'))) { $height = exec('tput lines'); $width = exec('tput cols');