Skip to content

Commit

Permalink
Patch stty results issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksagona committed Feb 28, 2024
1 parent def81e1 commit 163827c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 163827c

Please sign in to comment.