clear screen on windows during Screen.enter.

This commit is contained in:
Christopher Jeffrey 2015-04-27 01:23:30 -07:00
parent a42631cbc7
commit 582831e5bc

View File

@ -12,7 +12,8 @@ var EventEmitter = require('./events').EventEmitter
, assert = require('assert') , assert = require('assert')
, path = require('path') , path = require('path')
, util = require('util') , util = require('util')
, fs = require('fs'); , fs = require('fs')
, cp = require('child_process');
var colors = require('./colors') var colors = require('./colors')
, program = require('./program') , program = require('./program')
@ -448,6 +449,13 @@ Screen.prototype.enter = function() {
this.cursorColor(this.cursor.color); this.cursorColor(this.cursor.color);
} }
} }
if (process.platform === 'win32') {
try {
cp.execSync('cls', { stdio: 'ignore', timeout: 1000 });
} catch (e) {
;
}
}
this.program.alternateBuffer(); this.program.alternateBuffer();
this.program.put.keypad_xmit(); this.program.put.keypad_xmit();
this.program.csr(0, this.height - 1); this.program.csr(0, this.height - 1);