From f2c4c01d9ef58e5ac9d707d97ef8fc877bbd85c6 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 27 Feb 2013 18:34:41 -0600 Subject: [PATCH] expose data for debugging. --- lib/tput.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/tput.js b/lib/tput.js index fad6ecc..a6ed405 100644 --- a/lib/tput.js +++ b/lib/tput.js @@ -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'