Fixes regression introduced by #12576. Closes #12576

This commit is contained in:
Alexander Makarov
2016-10-12 00:38:04 +03:00
parent 2ffa670885
commit 75e43ccc3a

View File

@@ -613,8 +613,8 @@ class BaseConsole
if (static::isRunningOnWindows()) { if (static::isRunningOnWindows()) {
$output = []; $output = [];
exec('mode con', $output); exec('mode con', $output);
if (isset($output, $output[1]) && preg_match('/con:.*lines:\s+(\d+)\s+columns:\s+(\d+)/mi', implode(' ', $output), $matches)) { if (isset($output, $output[1]) && strpos($output[1], 'CON') !== false) {
return $size = [(int)$matches[2], (int)$matches[1]]; return $size = [(int) preg_replace('~\D~', '', $output[4]), (int) preg_replace('~\D~', '', $output[3])];
} }
} else { } else {
// try stty if available // try stty if available