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 8abf2c1 + 7a0ad26 commit e187756Copy full SHA for e187756
lib/cli/Shell.php
@@ -25,7 +25,7 @@ class Shell {
25
*/
26
static public function columns() {
27
if (stripos(PHP_OS, 'indows') === false) {
28
- return exec('/usr/bin/env tput cols');
+ return (int) exec('/usr/bin/env tput cols');
29
}
30
return 80; // default width of cmd window on Windows OS, maybe force using MODE CON COLS=XXX?
31
lib/cli/progress/Bar.php
@@ -56,6 +56,9 @@ public function display($finish = false) {
56
57
$size = Shell::columns();
58
$size -= strlen($msg . $timing);
59
+ if ( $size < 0 ) {
60
+ $size = 0;
61
+ }
62
63
$bar = str_repeat($this->_bars[0], floor($_percent * $size)) . $this->_bars[1];
64
// substr is needed to trim off the bar cap at 100%
0 commit comments