mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-29 19:42:45 +08:00
update files
This commit is contained in:
parent
fd024f01e1
commit
0b5daac020
@ -31,25 +31,29 @@ function Terminal(options){
|
|||||||
|
|
||||||
if (Array.isArray(options.colors)) {
|
if (Array.isArray(options.colors)) {
|
||||||
if (options.colors.length === 8) {
|
if (options.colors.length === 8) {
|
||||||
this.colors = options.colors.concat(Terminal.colors.slice(8));
|
options.colors = options.colors.concat(Terminal.colors.slice(8));
|
||||||
} else if (options.colors.length === 16) {
|
} else if (options.colors.length === 16) {
|
||||||
this.colors = options.colors.concat(Terminal.colors.slice(16));
|
options.colors = options.colors.concat(Terminal.colors.slice(16));
|
||||||
} else if (options.colors.length === 10) {
|
} else if (options.colors.length === 10) {
|
||||||
this.colors = options.colors.slice(0, -2).concat(Terminal.colors.slice(8, -2), options.colors.slice(-2));
|
options.colors = options.colors.slice(0, -2).concat(Terminal.colors.slice(8, -2), options.colors.slice(-2));
|
||||||
} else if (options.colors.length === 18) {
|
} else if (options.colors.length === 18) {
|
||||||
this.colors = options.colors.slice(0, -2).concat(Terminal.colors.slice(16, -2), options.colors.slice(-2));
|
options.colors = options.colors.slice(0, -2).concat(Terminal.colors.slice(16, -2), options.colors.slice(-2));
|
||||||
} else {
|
} else {
|
||||||
this.colors = Terminal.colors;
|
options.colors = Terminal.colors;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.colors = Terminal.colors;
|
options.colors = Terminal.colors;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.cols = options.cols || Terminal.geometry[0];
|
this.cols = options.cols || Terminal.geometry[0];
|
||||||
this.rows = options.rows || Terminal.geometry[1];
|
this.rows = options.rows || Terminal.geometry[1];
|
||||||
|
|
||||||
|
this.colors = options.colors;
|
||||||
this.bgColor = options.bgColor || Terminal.defaultColors.bgColor;
|
this.bgColor = options.bgColor || Terminal.defaultColors.bgColor;
|
||||||
this.fgColor = options.bgColor || Terminal.defaultColors.fgColor;
|
this.fgColor = options.bgColor || Terminal.defaultColors.fgColor;
|
||||||
|
|
||||||
|
this.options = options;
|
||||||
|
|
||||||
this.ybase = 0;
|
this.ybase = 0;
|
||||||
this.ydisp = 0;
|
this.ydisp = 0;
|
||||||
this.x = 0;
|
this.x = 0;
|
||||||
|
@ -7,7 +7,12 @@
|
|||||||
module.exports = function (Terminal){
|
module.exports = function (Terminal){
|
||||||
// ESC c Full Reset (RIS).
|
// ESC c Full Reset (RIS).
|
||||||
Terminal.prototype.reset = function (){
|
Terminal.prototype.reset = function (){
|
||||||
Terminal.call(this, this.cols, this.rows);
|
console.log(this.options);
|
||||||
|
|
||||||
|
this.options.rows = this.rows;
|
||||||
|
this.options.cols = this.cols;
|
||||||
|
|
||||||
|
Terminal.call(this, this.options);
|
||||||
this.refresh(0, this.rows - 1);
|
this.refresh(0, this.rows - 1);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -131,7 +131,7 @@ module.exports = function (Terminal){
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (ch <= ' ') {
|
if (ch <= ' ') {
|
||||||
out += ' ';
|
out += ' ';
|
||||||
} else {
|
} else {
|
||||||
if (this.isWide(ch)) i++;
|
if (this.isWide(ch)) i++;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user