function Console::getNumberOfColumnsInteractive
@codeCoverageIgnore
1 call to Console::getNumberOfColumnsInteractive()
- Console::getNumberOfColumns in vendor/
sebastian/ environment/ src/ Console.php - Returns the number of columns of the terminal.
File
-
vendor/
sebastian/ environment/ src/ Console.php, line 132
Class
Namespace
SebastianBergmann\EnvironmentCode
private function getNumberOfColumnsInteractive() : int {
if (function_exists('shell_exec') && preg_match('#\\d+ (\\d+)#', shell_exec('stty size') ?: '', $match) === 1) {
if ((int) $match[1] > 0) {
return (int) $match[1];
}
}
if (function_exists('shell_exec') && preg_match('#columns = (\\d+);#', shell_exec('stty') ?: '', $match) === 1) {
if ((int) $match[1] > 0) {
return (int) $match[1];
}
}
return 80;
}