Skip to content

Commit

Permalink
Check for TTY
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksagona committed Dec 12, 2023
1 parent 5f6a7ce commit 22186bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'))) {
Expand Down

0 comments on commit 22186bd

Please sign in to comment.