handle terminfo fallback better.

This commit is contained in:
Christopher Jeffrey 2013-03-05 17:38:41 -06:00
parent 87ffe00a06
commit 962a7bdcc6

View File

@ -51,15 +51,35 @@ function Tput(options) {
this.compileTerminfo();
}
} catch (e) {
// if (e.message === 'Terminal not found.') {
// If there was an error, fallback
// to an internally stored terminfo/cap.
this._useXtermI();
}
}
/**
* Fallback
*/
Tput.prototype._useVt102C = function() {
this.term = 'vt102';
this.termcap = true;
this.compileTermcap();
// this.term = 'xterm';
// this.termcap = true;
// this.termcapFile = __dirname + '/../usr/xterm.termcap';
// this.compileTermcap();
}
}
};
Tput.prototype._useXtermC = function() {
this.term = 'xterm';
this.termcap = true;
this.termcapFile = __dirname + '/../usr/xterm.termcap';
this.compileTermcap();
};
Tput.prototype._useXtermI = function() {
this.term = 'xterm';
this.termcap = false;
this.terminfoFile = __dirname + '/../usr/xterm.terminfo';
this.compileTerminfo();
};
/**
* Terminfo