File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -145,9 +145,9 @@ ProgressBar.prototype.render = function (tokens) {
145145 /* compute the available space (non-zero) for the bar */
146146 var availableSpace = Math . max ( 0 , this . stream . columns - str . replace ( ':bar' , '' ) . length ) ;
147147 if ( availableSpace && process . platform === 'win32' ) {
148- availableSpace = availableSpace - 1 ;
148+ availableSpace = availableSpace - 1 ;
149149 }
150-
150+
151151 var width = Math . min ( this . width , availableSpace ) ;
152152
153153 /* TODO: the following assumes the user has one ':bar' token */
@@ -221,8 +221,10 @@ ProgressBar.prototype.interrupt = function (message) {
221221
222222ProgressBar . prototype . terminate = function ( ) {
223223 if ( this . clear ) {
224- this . stream . clearLine ( ) ;
225- this . stream . cursorTo ( 0 ) ;
224+ if ( this . stream . clearLine ) {
225+ this . stream . clearLine ( ) ;
226+ this . stream . cursorTo ( 0 ) ;
227+ }
226228 } else {
227229 this . stream . write ( '\n' ) ;
228230 }
You can’t perform that action at this time.
0 commit comments