From 582831e5bcc308e1d932ee5a71bc771cb271d25a Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 27 Apr 2015 01:23:30 -0700 Subject: [PATCH] clear screen on windows during Screen.enter. --- lib/widget.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/widget.js b/lib/widget.js index 9f7b822..38e4690 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -12,7 +12,8 @@ var EventEmitter = require('./events').EventEmitter , assert = require('assert') , path = require('path') , util = require('util') - , fs = require('fs'); + , fs = require('fs') + , cp = require('child_process'); var colors = require('./colors') , program = require('./program') @@ -448,6 +449,13 @@ Screen.prototype.enter = function() { this.cursorColor(this.cursor.color); } } + if (process.platform === 'win32') { + try { + cp.execSync('cls', { stdio: 'ignore', timeout: 1000 }); + } catch (e) { + ; + } + } this.program.alternateBuffer(); this.program.put.keypad_xmit(); this.program.csr(0, this.height - 1);