update files

This commit is contained in:
nuintun 2015-11-30 15:35:46 +08:00
parent b8a37cc664
commit 31a181e6a3

View File

@ -941,16 +941,34 @@ var TERM_STRING = {
* @constructor
*/
function AnsiTerminal(cols, rows, scrollLength){
if (!(this instanceof AnsiTerminal)) {
return new AnsiTerminal(cols, rows, scrollLength);
}
this.rows = rows;
this.cols = cols;
this.scrollLength = scrollLength | 0;
this.send = function (s){}; // callback for writing back to stream
this.beep = function (tone, duration){}; // callback for sending console beep
this.changedMouseHandling = function (mode, protocol){}; // announce changes in mouse handling
// callback for writing back to stream
this.send = function (data){};
// 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();
}
/**
* write
* @param data
*/
AnsiTerminal.prototype.write = function (data){
this.AnsiParser.parse(data);
};
/** Hard reset of the terminal. */
AnsiTerminal.prototype.reset = function (){
this.normal_screen = new ScreenBuffer(this.cols, this.rows, this.scrollLength);