Skip to content

Commit

Permalink
Update Terminal.php
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Nov 11, 2024
1 parent e09313c commit 53d52d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Console/Terminal.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ private static function initDimensions(): void
{
$consoleMode = self::getConsoleMode();

if ('\\' === \DIRECTORY_SEPARATOR && is_string(\getenv('ANSICON'))) {
if (\preg_match('#^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$#', \trim(\getenv('ANSICON')), $matches)) {
if ('\\' === \DIRECTORY_SEPARATOR) {
if (is_string(\getenv('ANSICON')) && \preg_match('#^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$#', \trim(\getenv('ANSICON')), $matches)) {
self::$width = (int) $matches[1];
} elseif (! self::hasVt100Support() && self::hasSttyAvailable()) {
self::initDimensionsUsingStty();
Expand Down

0 comments on commit 53d52d1

Please sign in to comment.