refactor
This commit is contained in:
parent
983dfa943e
commit
8a3f29fddb
|
@ -76,15 +76,15 @@ Program.prototype.setupTput = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.keys(tput).forEach(function(key) {
|
Object.keys(tput).forEach(function(key) {
|
||||||
if (self[key] != null) return;
|
if (self[key] == null) {
|
||||||
self[key] = tput[key];
|
self[key] = tput[key];
|
||||||
});
|
}
|
||||||
|
|
||||||
Object.keys(tput).forEach(function(key) {
|
|
||||||
if (typeof tput[key] !== 'function') {
|
if (typeof tput[key] !== 'function') {
|
||||||
self.put[key] = tput[key];
|
self.put[key] = tput[key];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.padding) {
|
if (options.padding) {
|
||||||
self.put[key] = function() {
|
self.put[key] = function() {
|
||||||
return tput._print(tput[key].apply(tput, arguments), write);
|
return tput._print(tput[key].apply(tput, arguments), write);
|
||||||
|
@ -1081,7 +1081,7 @@ Program.prototype.eraseInDisplay = function(param) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Program.prototype.clear = function() {
|
Program.prototype.clear = function() {
|
||||||
if (this.tput) return this.tput.clear();
|
if (this.tput) return this.put.clear();
|
||||||
return this.write('\x1b[H\x1b[J');
|
return this.write('\x1b[H\x1b[J');
|
||||||
// return this.ed('all');
|
// return this.ed('all');
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue