From 22186bde42406669335e31814e4250915238b034 Mon Sep 17 00:00:00 2001 From: Nick Sagona Date: Tue, 12 Dec 2023 14:36:01 -0600 Subject: [PATCH] Check for TTY --- src/Console.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Console.php b/src/Console.php index f2b4475..d5b01e4 100644 --- a/src/Console.php +++ b/src/Console.php @@ -112,7 +112,7 @@ public function __construct(?int $wrap = 80, int|string $margin = 4) $height = null; $width = null; - if (function_exists('exec')) { + if (function_exists('exec') && stream_isatty(STDERR)) { if (!empty(exec('which stty'))) { [$height, $width] = explode(' ', exec('stty size'), 2); } else if (!empty(exec('which tput'))) {