We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 228e8c1 + 0e60324 commit 6bff21fCopy full SHA for 6bff21f
lib/cli/Shell.php
@@ -28,12 +28,21 @@ static public function columns() {
28
static $columns;
29
30
if ( null === $columns ) {
31
- if ( ! self::is_windows() ) {
+ if (self::is_windows() ) {
32
+ $output = array();
33
+ exec('mode CON', $output);
34
+ foreach ($output as $line) {
35
+ if (preg_match('/Columns:( )*([0-9]+)/', $line, $matches)) {
36
+ $columns = (int)$matches[2];
37
+ break;
38
+ }
39
40
+ } else {
41
$columns = (int) exec('/usr/bin/env tput cols');
42
}
43
44
if ( !$columns ) {
- $columns = 80; // default width of cmd window on Windows OS, maybe force using MODE CON COLS=XXX?
45
+ $columns = 80; // default width of cmd window on Windows OS
46
47
48
0 commit comments