this._terminal.cursorHidden = false;
break;
case 1049: // alt screen buffer cursor
- this.saveCursor(params);
+ // TODO: Not sure if we need to save/restore after switching the buffer
+ // this.saveCursor(params);
// FALL-THROUGH
case 47: // alt screen buffer
case 1047: // alt screen buffer
case 1047: // normal screen buffer - clearing it first
// Ensure the selection manager has the correct buffer
this._terminal.buffers.activateNormalBuffer();
- if (params[0] === 1049) {
- this.restoreCursor(params);
- }
+ // TODO: Not sure if we need to save/restore after switching the buffer
+ // if (params[0] === 1049) {
+ // this.restoreCursor(params);
+ // }
this._terminal.selectionManager.setBuffer(this._terminal.buffer.lines);
this._terminal.refresh(0, this._terminal.rows - 1);
this._terminal.viewport.syncScrollArea();
* Save cursor (ANSI.SYS).
*/
public saveCursor(params: number[]): void {
- this._terminal.buffers.active.x = this._terminal.buffer.x;
- this._terminal.buffers.active.y = this._terminal.buffer.y;
+ this._terminal.buffer.savedX = this._terminal.buffer.x;
+ this._terminal.buffer.savedY = this._terminal.buffer.y;
}
* Restore cursor (ANSI.SYS).
*/
public restoreCursor(params: number[]): void {
- this._terminal.buffer.x = this._terminal.buffers.active.x || 0;
- this._terminal.buffer.y = this._terminal.buffers.active.y || 0;
+ this._terminal.buffer.x = this._terminal.buffer.savedX || 0;
+ this._terminal.buffer.y = this._terminal.buffer.savedY || 0;
}
}
public parse(data: string): ParserState {
let l = data.length, j, cs, ch, code, low;
+ if (this._terminal.debug) {
+ this._terminal.log('data: ' + data);
+ }
+
this._position = 0;
// apply leftover surrogate high from last write
if (this._terminal.surrogate_high) {
case ParserState.CSI:
if (ch in csiStateHandler) {
+ if (this._terminal.debug) {
+ this._terminal.log(`CSI ${this._terminal.prefix ? this._terminal.prefix : ''} ${this._terminal.params ? this._terminal.params.join(';') : ''} ${this._terminal.postfix ? this._terminal.postfix : ''} ${ch}`);
+ }
csiStateHandler[ch](this._inputHandler, this._terminal.params, this._terminal.prefix, this._terminal.postfix, this);
} else {
this._terminal.error('Unknown CSI code: %s.', ch);