This commit is contained in:
Christopher Jeffrey 2013-02-22 16:12:34 -06:00
parent 6dad574249
commit f26d4dd93a
2 changed files with 8 additions and 8 deletions

View File

@ -13,5 +13,5 @@ var tput = new Tput(process.argv[2] || 'xterm', true);
//console.log(tput.methods.set_attributes([34]) + 'foo' + tput.methods.set_attributes([0]));
//console.log(tput.set_attributes(34) + 'foo' + tput.set_attributes(0));
//tput.readTermCap();
//tput.readTermcap();
//console.log(tput.termcap.terms);

View File

@ -32,11 +32,11 @@ function Tput(term, debug) {
this.info = {};
this.debug = debug;
this.readTermInfo();
this.readTerminfo();
this.compile();
}
Tput.prototype.readTermInfo = function() {
Tput.prototype.readTerminfo = function() {
if (this.data) return;
var file = path.resolve(
@ -46,7 +46,7 @@ Tput.prototype.readTermInfo = function() {
);
this.data = fs.readFileSync(file);
this.info = this.parseTermInfo(this.data);
this.info = this.parseTerminfo(this.data);
return this.info;
};
@ -56,7 +56,7 @@ Tput.prototype.readTermInfo = function() {
* All shorts are little-endian
*/
Tput.prototype.parseTermInfo = function(data) {
Tput.prototype.parseTerminfo = function(data) {
var info = {}
, l = data.length
, i = 0;
@ -744,7 +744,7 @@ Tput.prototype.setupAliases = function(info) {
* Termcap
*/
Tput.prototype.readTermCap = function() {
Tput.prototype.readTermcap = function() {
if (this.termcap) return;
this.termcap = {};
@ -756,7 +756,7 @@ Tput.prototype.readTermCap = function() {
this.termcap.data = fs.readFileSync(file, 'utf8');
}
this.termcap.terms = this.parseTermCap(this.termcap.data);
this.termcap.terms = this.parseTermcap(this.termcap.data);
this.termcap.info = this.termcap.terms[this.term];
return this.termcap;
@ -783,7 +783,7 @@ Tput.prototype.readTermCap = function() {
// :sc=\E7:rc=\E8:cs=\E[%i%d;%dr:vs=\E[?7l:ve=\E[?7h:\
// :mi:al=\E[L:dc=\E[P:dl=\E[M:ei=\E[4l:im=\E[4h:
Tput.prototype.parseTermCap = function(data) {
Tput.prototype.parseTermcap = function(data) {
var terms = {}
, term
, entries