Skip to content

Commit 971eef9

Browse files
Merge pull request #116 from sjfkai/master
fixed output multiline on windows cmd
2 parents dcecd65 + c48e4f7 commit 971eef9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/node-progress.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ ProgressBar.prototype.render = function (tokens) {
142142

143143
/* compute the available space (non-zero) for the bar */
144144
var availableSpace = Math.max(0, this.stream.columns - str.replace(':bar', '').length);
145+
if(availableSpace && process.platform === 'win32'){
146+
availableSpace = availableSpace - 1;
147+
}
148+
145149
var width = Math.min(this.width, availableSpace);
146150

147151
/* TODO: the following assumes the user has one ':bar' token */

0 commit comments

Comments
 (0)