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 e187756 + 6079f27 commit ee739f6Copy full SHA for ee739f6
lib/cli/Shell.php
@@ -24,10 +24,19 @@ class Shell {
24
* @todo Test on more systems.
25
*/
26
static public function columns() {
27
- if (stripos(PHP_OS, 'indows') === false) {
28
- return (int) exec('/usr/bin/env tput cols');
+ static $columns;
+
29
+ if ( null === $columns ) {
30
+ if (stripos(PHP_OS, 'indows') === false) {
31
+ $columns = (int) exec('/usr/bin/env tput cols');
32
+ }
33
34
+ if ( !$columns ) {
35
+ $columns = 80; // default width of cmd window on Windows OS, maybe force using MODE CON COLS=XXX?
36
37
}
- return 80; // default width of cmd window on Windows OS, maybe force using MODE CON COLS=XXX?
38
39
+ return $columns;
40
41
42
/**
0 commit comments