Skip to content

Commit f492b12

Browse files
committed
bug #14250 [Console] Fixed SymfonyStyle when get terminal width fails (1ed)
This PR was merged into the 2.7 branch. Discussion ---------- [Console] Fixed SymfonyStyle when get terminal width fails | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- a52b658 [Console] Fixed SymfonyStyle when get terminal width fails
2 parents b01ed89 + a52b658 commit f492b12

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Console/Style/SymfonyStyle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ private function getProgressBar()
316316
private function getTerminalWidth()
317317
{
318318
$application = new Application();
319-
list ($width, $height) = $application->getTerminalDimensions();
319+
$dimensions = $application->getTerminalDimensions();
320320

321-
return $width;
321+
return $dimensions[0] ?: self::MAX_LINE_LENGTH;
322322
}
323323
}

0 commit comments

Comments
 (0)