mirror of
https://github.com/nuintun/command-manager.git
synced 2025-07-20 01:19:36 +08:00
update files
This commit is contained in:
parent
b8a37cc664
commit
31a181e6a3
@ -941,16 +941,34 @@ var TERM_STRING = {
|
|||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function AnsiTerminal(cols, rows, scrollLength){
|
function AnsiTerminal(cols, rows, scrollLength){
|
||||||
|
if (!(this instanceof AnsiTerminal)) {
|
||||||
|
return new AnsiTerminal(cols, rows, scrollLength);
|
||||||
|
}
|
||||||
|
|
||||||
this.rows = rows;
|
this.rows = rows;
|
||||||
this.cols = cols;
|
this.cols = cols;
|
||||||
this.scrollLength = scrollLength | 0;
|
this.scrollLength = scrollLength | 0;
|
||||||
this.send = function (s){}; // callback for writing back to stream
|
// callback for writing back to stream
|
||||||
this.beep = function (tone, duration){}; // callback for sending console beep
|
this.send = function (data){};
|
||||||
this.changedMouseHandling = function (mode, protocol){}; // announce changes in mouse handling
|
// callback for sending console beep
|
||||||
|
this.beep = function (tone, duration){};
|
||||||
|
// announce changes in mouse handling
|
||||||
|
this.changedMouseHandling = function (mode, protocol){};
|
||||||
|
|
||||||
|
// init ansi parser
|
||||||
|
this.AnsiParser = new AnsiParser(this);
|
||||||
|
|
||||||
this.reset();
|
this.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* write
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
AnsiTerminal.prototype.write = function (data){
|
||||||
|
this.AnsiParser.parse(data);
|
||||||
|
};
|
||||||
|
|
||||||
/** Hard reset of the terminal. */
|
/** Hard reset of the terminal. */
|
||||||
AnsiTerminal.prototype.reset = function (){
|
AnsiTerminal.prototype.reset = function (){
|
||||||
this.normal_screen = new ScreenBuffer(this.cols, this.rows, this.scrollLength);
|
this.normal_screen = new ScreenBuffer(this.cols, this.rows, this.scrollLength);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user