fix clr_eos/ed and other possible collisions.
This commit is contained in:
parent
68911aa357
commit
ea4542027b
|
@ -1053,7 +1053,9 @@ Program.prototype.eraseInDisplay = function(param) {
|
|||
};
|
||||
|
||||
Program.prototype.clear = function() {
|
||||
return this.eraseInDisplay('all');
|
||||
if (this.tput) return this.tput.clear();
|
||||
return this.write('\x1b[H\x1b[J');
|
||||
// return this.ed('all');
|
||||
};
|
||||
|
||||
// CSI Ps K Erase in Line (EL).
|
||||
|
|
25
lib/tput.js
25
lib/tput.js
|
@ -1188,6 +1188,31 @@ delete Tput.alias.numbers;
|
|||
merge(Tput.alias, Tput.alias.strings);
|
||||
delete Tput.alias.strings;
|
||||
|
||||
// Make sure there are no collisions between cap and tcap.
|
||||
Tput._vec = [];
|
||||
|
||||
Object.keys(Tput.alias).forEach(function(key) {
|
||||
if (!Array.isArray(Tput.alias[key])) {
|
||||
return Tput._vec.push(Tput.alias[key]);
|
||||
}
|
||||
Tput._vec.push(Tput.alias[key][0]);
|
||||
});
|
||||
|
||||
Object.keys(Tput.alias).forEach(function(key) {
|
||||
if (!Array.isArray(Tput.alias[key])) {
|
||||
return;
|
||||
}
|
||||
|
||||
var alias = Tput.alias[key]
|
||||
, tcap = alias[1];
|
||||
|
||||
if (!tcap) return;
|
||||
|
||||
if (~Tput._vec.indexOf(tcap)) {
|
||||
alias.splice(1, 1);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Terminfo Data
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue