diff --git a/.gitignore b/.gitignore index 6ff2f90..d905c43 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ node_modules *.sock npm-debug.log yarn.lock +.idea \ No newline at end of file diff --git a/lib/node-progress.js b/lib/node-progress.js index 8eb0740..9751f18 100644 --- a/lib/node-progress.js +++ b/lib/node-progress.js @@ -148,7 +148,7 @@ ProgressBar.prototype.render = function (tokens, force) { .replace(':rate', Math.round(rate)); /* compute the available space (non-zero) for the bar */ - var availableSpace = Math.max(0, this.stream.columns - str.replace(':bar', '').length); + var availableSpace = Math.max(0, ...str.replace(':bar', '').split('\n').map(line => this.stream.columns - line.length)); if(availableSpace && process.platform === 'win32'){ availableSpace = availableSpace - 1; }