always default to windows-ansi on windows. minor refactor.

This commit is contained in:
Christopher Jeffrey 2013-08-29 18:00:13 -05:00
parent a14650860d
commit b5026af628
1 changed files with 5 additions and 3 deletions

View File

@ -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);