recursively inherit from other termcap entries.

This commit is contained in:
Christopher Jeffrey 2013-02-28 01:26:08 -06:00
parent 6acb18fba4
commit 4ed0bda9ff
1 changed files with 15 additions and 2 deletions

View File

@ -999,13 +999,26 @@ Tput.prototype.readTermcap = function(data) {
|| tryRead('/etc/termcap')
|| Tput.termcap;
var terms = this.parseTermcap(data);
var terms = this.parseTermcap(data)
, term = terms[this.term];
if (this.debug) {
this._termcap = terms;
}
return terms[this.term];
(function tc(term) {
if (term && term.strings.tc) {
var inherit = tc(terms[term.strings.tc]);
if (inherit) {
['bools', 'numbers', 'strings'].forEach(function(type) {
merge(term[type], inherit[type]);
});
}
}
return term;
})(term);
return term;
};
/**