Fixed cursor hiding and showing.

git-svn-id: https://shellinabox.googlecode.com/svn/trunk@58 0da03de8-d603-11dd-86c2-0f8696b7b6f9
This commit is contained in:
zodiac 2009-02-09 17:15:32 +00:00
parent ef921b0ba2
commit f969b8b19c

View file

@ -1289,7 +1289,7 @@ VT100.prototype.scrollRegion = function(x, y, w, h, incX, incY, style) {
// Determine original cursor position. Hide cursor temporarily to avoid // Determine original cursor position. Hide cursor temporarily to avoid
// visual artifacts. // visual artifacts.
var visible = this.hideCursor(); var hidden = this.hideCursor();
var cx = this.cursorX; var cx = this.cursorX;
var cy = this.cursorY; var cy = this.cursorY;
var console = this.console[this.currentScreen]; var console = this.console[this.currentScreen];
@ -1396,7 +1396,7 @@ VT100.prototype.scrollRegion = function(x, y, w, h, incX, incY, style) {
this.cursorHeight + 1; this.cursorHeight + 1;
// Move cursor back to its original position // Move cursor back to its original position
visible ? this.showCursor(cx, cy) : this.putString(cx, cy, '', undefined); hidden ? this.showCursor(cx, cy) : this.putString(cx, cy, '', undefined);
} }
}; };
@ -2304,7 +2304,8 @@ VT100.prototype.setMode = function(state) {
case 7: this.autoWrapMode = state; break; case 7: this.autoWrapMode = state; break;
case 1000: case 1000:
case 9: this.mouseReporting = state; break; case 9: this.mouseReporting = state; break;
case 25: if (state) { this.showCursor(); } case 25: this.cursorNeedsShowing = state;
if (state) { this.showCursor(); }
else { this.hideCursor(); } break; else { this.hideCursor(); } break;
case 1047: case 1047:
case 1049: case 1049:
@ -2827,7 +2828,7 @@ VT100.prototype.renderString = function(s, showCursor) {
}; };
VT100.prototype.vt100 = function(s) { VT100.prototype.vt100 = function(s) {
var visible = this.hideCursor(); this.cursorNeedsShowing = this.hideCursor();
this.respondString = ''; this.respondString = '';
var lineBuf = ''; var lineBuf = '';
for (var i = 0; i < s.length; i++) { for (var i = 0; i < s.length; i++) {
@ -2918,8 +2919,8 @@ VT100.prototype.vt100 = function(s) {
} }
} }
if (lineBuf) { if (lineBuf) {
this.renderString(lineBuf, true); this.renderString(lineBuf, this.cursorNeedsShowing);
} else if (visible) { } else if (this.cursorNeedsShowing) {
this.showCursor(); this.showCursor();
} }
return this.respondString; return this.respondString;