diff --git a/lib/program.js b/lib/program.js index 4c346d4..6a1af0b 100644 --- a/lib/program.js +++ b/lib/program.js @@ -54,11 +54,10 @@ function Program(options) { Program.prototype.__proto__ = EventEmitter.prototype; -Program.prototype.setupTput = function(is) { +Program.prototype.setupTput = function() { var self = this - , options = this.options; - - var write = this.write.bind(this); + , options = this.options + , write = this.write.bind(this); var tput = this.tput = new Tput({ term: this.terminal, @@ -76,6 +75,11 @@ Program.prototype.setupTput = function(is) { } }; + Object.keys(tput).forEach(function(key) { + if (self[key] != null) return; + self[key] = tput[key]; + }); + Object.keys(tput).forEach(function(key) { if (typeof tput[key] !== 'function') { self.put[key] = tput[key];