Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/cli/Shell.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Shell {
*/
static public function columns() {
if (stripos(PHP_OS, 'indows') === false) {
return exec('/usr/bin/env tput cols');
return (int) exec('/usr/bin/env tput cols');
}
return 80; // default width of cmd window on Windows OS, maybe force using MODE CON COLS=XXX?
}
Expand Down
3 changes: 3 additions & 0 deletions lib/cli/progress/Bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public function display($finish = false) {

$size = Shell::columns();
$size -= strlen($msg . $timing);
if ( $size < 0 ) {
$size = 0;
}

$bar = str_repeat($this->_bars[0], floor($_percent * $size)) . $this->_bars[1];
// substr is needed to trim off the bar cap at 100%
Expand Down