diff --git a/lib/node-progress.js b/lib/node-progress.js index 8eb0740..be19c98 100644 --- a/lib/node-progress.js +++ b/lib/node-progress.js @@ -147,8 +147,8 @@ ProgressBar.prototype.render = function (tokens, force) { .replace(':percent', percent.toFixed(0) + '%') .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); + /* compute the available space (non-zero) for the bar. We should substract 1 because of the end line feed character*/ + var availableSpace = Math.max(0, this.stream.columns - str.replace(':bar', '').length - 1); if(availableSpace && process.platform === 'win32'){ availableSpace = availableSpace - 1; }