always default to windows-ansi on windows. minor refactor.
This commit is contained in:
parent
a14650860d
commit
b5026af628
|
@ -11,7 +11,9 @@
|
||||||
var EventEmitter = require('events').EventEmitter
|
var EventEmitter = require('events').EventEmitter
|
||||||
, StringDecoder = require('string_decoder').StringDecoder
|
, StringDecoder = require('string_decoder').StringDecoder
|
||||||
, util = require('util')
|
, util = require('util')
|
||||||
, Tput = require('./tput')
|
, fs = require('fs');
|
||||||
|
|
||||||
|
var Tput = require('./tput')
|
||||||
, colors = require('./colors')
|
, colors = require('./colors')
|
||||||
, slice = Array.prototype.slice;
|
, slice = Array.prototype.slice;
|
||||||
|
|
||||||
|
@ -41,7 +43,7 @@ function Program(options) {
|
||||||
|
|
||||||
options.log = options.log || options.dump;
|
options.log = options.log || options.dump;
|
||||||
if (options.log) {
|
if (options.log) {
|
||||||
this._logger = require('fs').createWriteStream(options.log);
|
this._logger = fs.createWriteStream(options.log);
|
||||||
if (options.dump) this.setupDump();
|
if (options.dump) this.setupDump();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +64,7 @@ function Program(options) {
|
||||||
this.terminal = options.term
|
this.terminal = options.term
|
||||||
|| options.terminal
|
|| options.terminal
|
||||||
|| process.env.TERM
|
|| process.env.TERM
|
||||||
|| 'xterm';
|
|| (process.platform === 'win32' ? 'windows-ansi' : 'xterm');
|
||||||
|
|
||||||
this._buf = '';
|
this._buf = '';
|
||||||
this._flush = this.flush.bind(this);
|
this._flush = this.flush.bind(this);
|
||||||
|
|
Loading…
Reference in New Issue