function Terminal::getConsoleMode
Runs and parses mode CON if it's available, suppressing any error output.
Return value
int[]|null An array composed of the width and the height or null if it could not be parsed
1 call to Terminal::getConsoleMode()
- Terminal::initDimensions in vendor/
symfony/ console/ Terminal.php
File
-
vendor/
symfony/ console/ Terminal.php, line 180
Class
Namespace
Symfony\Component\ConsoleCode
private static function getConsoleMode() : ?array {
$info = self::readFromProcess('mode CON');
if (null === $info || !preg_match('/--------+\\r?\\n.+?(\\d+)\\r?\\n.+?(\\d+)\\r?\\n/', $info, $matches)) {
return null;
}
return [
(int) $matches[2],
(int) $matches[1],
];
}