recursively inherit from other termcap entries.
This commit is contained in:
parent
6acb18fba4
commit
4ed0bda9ff
17
lib/tput.js
17
lib/tput.js
|
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue