mirror of
https://github.com/nuintun/command-manager.git
synced 2025-10-20 09:51:31 +08:00
update files
This commit is contained in:
45
bin/terminal/lib/esc/index.js
Normal file
45
bin/terminal/lib/esc/index.js
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* Created by nuintun on 2015/11/24.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var states = require('../states');
|
||||
|
||||
module.exports = function (Terminal){
|
||||
// ESC D Index (IND is 0x84).
|
||||
Terminal.prototype.index = function (){
|
||||
this.y++;
|
||||
|
||||
if (this.y > this.scrollBottom) {
|
||||
this.y--;
|
||||
this.scroll();
|
||||
}
|
||||
|
||||
this.state = states.normal;
|
||||
};
|
||||
|
||||
// ESC M Reverse Index (RI is 0x8d).
|
||||
Terminal.prototype.reverseIndex = function (){
|
||||
var j;
|
||||
|
||||
this.y--;
|
||||
|
||||
if (this.y < this.scrollTop) {
|
||||
this.y++;
|
||||
|
||||
// possibly move the code below to term.reverseScroll();
|
||||
// test: echo -ne '\e[1;1H\e[44m\eM\e[0m'
|
||||
// blankLine(true) is xterm/linux behavior
|
||||
this.lines.splice(this.y + this.ybase, 0, this.blankLine(true));
|
||||
|
||||
j = this.rows - 1 - this.scrollBottom;
|
||||
|
||||
this.lines.splice(this.rows - 1 + this.ybase - j + 1, 1);
|
||||
this.updateRange(this.scrollTop);
|
||||
this.updateRange(this.scrollBottom);
|
||||
}
|
||||
|
||||
this.state = states.normal;
|
||||
};
|
||||
};
|
29
bin/terminal/lib/esc/reset.js
Normal file
29
bin/terminal/lib/esc/reset.js
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Created by nuintun on 2015/11/24.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function (Terminal){
|
||||
// ESC c Full Reset (RIS).
|
||||
Terminal.prototype.reset = function (){
|
||||
var parent;
|
||||
|
||||
if (this.element) {
|
||||
parent = this.element.parentNode;
|
||||
|
||||
if (parent) {
|
||||
parent.removeChild(this.element);
|
||||
}
|
||||
}
|
||||
|
||||
Terminal.call(this, this.options);
|
||||
|
||||
this.open();
|
||||
this.refresh(0, this.rows - 1);
|
||||
|
||||
if (parent) {
|
||||
parent.appendChild(this.element);
|
||||
}
|
||||
};
|
||||
};
|
14
bin/terminal/lib/esc/tabSet.js
Normal file
14
bin/terminal/lib/esc/tabSet.js
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Created by nuintun on 2015/11/24.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
var states = require('../states');
|
||||
|
||||
module.exports = function (Terminal){
|
||||
// ESC H Tab Set (HTS is 0x88).
|
||||
Terminal.prototype.tabSet = function (){
|
||||
this.tabs[this.x] = true;
|
||||
this.state = states.normal;
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user