expose data for debugging.

This commit is contained in:
Christopher Jeffrey 2013-02-27 18:34:41 -06:00
parent fbd85c660b
commit f2c4c01d9e
1 changed files with 15 additions and 3 deletions

View File

@ -65,7 +65,14 @@ Tput.prototype.readTerminfo = function(data) {
);
data = fs.readFileSync(file);
}
return this.parseTerminfo(data);
var info = this.parseTerminfo(data);
if (this.debug) {
this._terminfo = info;
}
return info;
};
/**
@ -987,9 +994,14 @@ Tput.prototype.readTermcap = function(data) {
var data = data
|| process.env.TERMCAP
|| tryRead('/etc/termcap')
|| Tput.vt102;
|| Tput.termcap;
var terms = this.parseTermcap(data);
if (this.debug) {
this._termcap = terms;
}
return terms[this.term];
};
@ -1323,7 +1335,7 @@ assert.notEqual(Tput.alias.exit_delete_mode[1], 'ed');
* Fallback Termcap Entry
*/
Tput.vt102 = ''
Tput.termcap = ''
+ 'vt102|dec vt102:\\\n'
+ ' :do=^J:co#80:li#24:cl=50\\E[;H\\E[2J:\\\n'
+ ' :le=^H:bs:cm=5\\E[%i%d;%dH:nd=2\\E[C:up=2\\E[A:\\\n'