update files

This commit is contained in:
nuintun 2015-11-25 12:41:42 +08:00
parent d9b3859480
commit fe56467a2e
3 changed files with 17 additions and 6 deletions

View File

@ -53,6 +53,9 @@ function Terminal(options){
this.bgColor = options.bgColor || Terminal.defaultColors.bgColor; this.bgColor = options.bgColor || Terminal.defaultColors.bgColor;
this.fgColor = options.fgColor || Terminal.defaultColors.fgColor; this.fgColor = options.fgColor || Terminal.defaultColors.fgColor;
options.handler = typeof options.handler === 'function' ? options.handler : function (){};
this.handler = options.handler;
this.options = options; this.options = options;
this.ybase = 0; this.ybase = 0;

View File

@ -22,10 +22,10 @@ module.exports = function (Terminal){
Terminal.prototype.startBlink = function (){ Terminal.prototype.startBlink = function (){
if (!this.cursorBlink) return; if (!this.cursorBlink) return;
var self = this; var context = this;
this._blinker = function (){ this._blinker = function (){
self.blinkCursor(); context.blinkCursor();
}; };
this._blink = setInterval(this._blinker, 500); this._blink = setInterval(this._blinker, 500);

View File

@ -18,12 +18,12 @@ module.exports = function (Terminal){
if (!this.visualBell) return; if (!this.visualBell) return;
var self = this; var context = this;
this.element.style.borderColor = 'white'; this.element.style.borderColor = 'white';
setTimeout(function (){ setTimeout(function (){
self.element.style.borderColor = ''; context.element.style.borderColor = '';
}, 10); }, 10);
if (this.popOnBell) this.focus(); if (this.popOnBell) this.focus();
@ -695,31 +695,39 @@ module.exports = function (Terminal){
// Request Status String (DECRQSS). // Request Status String (DECRQSS).
// test: echo -e '\eP$q"p\e\\' // test: echo -e '\eP$q"p\e\\'
case '$q': case '$q':
var pt = this.currentParam, var valid = 0;
valid = false; var pt = this.currentParam;
switch (pt) { switch (pt) {
// DECSCA // DECSCA
case '"q': case '"q':
pt = '0"q'; pt = '0"q';
valid = 1;
break; break;
// DECSCL // DECSCL
case '"p': case '"p':
pt = '61"p'; pt = '61"p';
valid = 1;
break; break;
// DECSTBM // DECSTBM
case 'r': case 'r':
pt = '' + (this.scrollTop + 1) + ';' + (this.scrollBottom + 1) + 'r'; pt = '' + (this.scrollTop + 1) + ';' + (this.scrollBottom + 1) + 'r';
valid = 1;
break; break;
// SGR // SGR
case 'm': case 'm':
pt = '0m'; pt = '0m';
valid = 1;
break; break;
default: default:
this.error('Unknown DCS Pt: %s.', pt); this.error('Unknown DCS Pt: %s.', pt);
valid = 0;
pt = ''; pt = '';
break; break;
} }
// -this.send('\x1bP' + valid + '$r' + pt + '\x1b\\');
break; break;
// Set Termcap/Terminfo Data (xterm, experimental). // Set Termcap/Terminfo Data (xterm, experimental).
case '+p': case '+p':