76 if (
'\\' === \DIRECTORY_SEPARATOR) {
77 if (\preg_match(
'/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', \trim(\getenv(
'ANSICON')), $matches)) {
80 self::$width = (int) $matches[1];
81 self::$height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2];
82 } elseif (! self::hasVt100Support() && self::hasSttyAvailable()) {
86 } elseif (
null !== $dimensions = self::getConsoleMode()) {
88 self::$width = (int) $dimensions[0];
89 self::$height = (int) $dimensions[1];
107 if ($sttyString = self::getSttyColumns()) {
108 if (\preg_match(
'/rows.(\d+);.columns.(\d+);/i', $sttyString, $matches)) {
110 self::$width = (int) $matches[2];
111 self::$height = (int) $matches[1];
112 } elseif (\preg_match(
'/;.(\d+).rows;.(\d+).columns/i', $sttyString, $matches)) {
114 self::$width = (int) $matches[2];
115 self::$height = (int) $matches[1];