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
This commit is contained in:
commit
f492b12158
@ -316,8 +316,8 @@ class SymfonyStyle extends OutputStyle
|
|||||||
private function getTerminalWidth()
|
private function getTerminalWidth()
|
||||||
{
|
{
|
||||||
$application = new Application();
|
$application = new Application();
|
||||||
list ($width, $height) = $application->getTerminalDimensions();
|
$dimensions = $application->getTerminalDimensions();
|
||||||
|
|
||||||
return $width;
|
return $dimensions[0] ?: self::MAX_LINE_LENGTH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user