From b5026af628f8af2f9803d3b43f1cb785f75e6300 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 29 Aug 2013 18:00:13 -0500 Subject: [PATCH] always default to windows-ansi on windows. minor refactor. --- lib/program.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/program.js b/lib/program.js index 9380a8e..17a0b53 100644 --- a/lib/program.js +++ b/lib/program.js @@ -11,7 +11,9 @@ var EventEmitter = require('events').EventEmitter , StringDecoder = require('string_decoder').StringDecoder , util = require('util') - , Tput = require('./tput') + , fs = require('fs'); + +var Tput = require('./tput') , colors = require('./colors') , slice = Array.prototype.slice; @@ -41,7 +43,7 @@ function Program(options) { options.log = options.log || options.dump; if (options.log) { - this._logger = require('fs').createWriteStream(options.log); + this._logger = fs.createWriteStream(options.log); if (options.dump) this.setupDump(); } @@ -62,7 +64,7 @@ function Program(options) { this.terminal = options.term || options.terminal || process.env.TERM - || 'xterm'; + || (process.platform === 'win32' ? 'windows-ansi' : 'xterm'); this._buf = ''; this._flush = this.flush.bind(this);