From 6deaaa8ef8e87a9993a6c4737eb88b7dcc8593e4 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 9 Jan 2017 15:00:37 -0800 Subject: [PATCH] Move all parser state handling into the parser --- src/Parser.ts | 3 +++ src/xterm.js | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Parser.ts b/src/Parser.ts index ef10abc..42d429a 100644 --- a/src/Parser.ts +++ b/src/Parser.ts @@ -206,11 +206,13 @@ export class Parser { ; case 'D': this._terminal.index(); + this.state = ParserState.NORMAL; break; // ESC M Reverse Index ( RI is 0x8d). case 'M': this._terminal.reverseIndex(); + this.state = ParserState.NORMAL; break; // ESC % Select default/utf-8 character set. @@ -319,6 +321,7 @@ export class Parser { // ESC H Tab Set (HTS is 0x88). case 'H': this._terminal.tabSet(); + this.state = ParserState.NORMAL; break; // ESC = Application Keypad (DECKPAM). diff --git a/src/xterm.js b/src/xterm.js index a100f80..bf9f985 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -148,7 +148,6 @@ function Terminal(options) { this.cursorState = 0; this.cursorHidden = false; this.convertEol; - this.state = 0; this.queue = ''; this.scrollTop = 0; this.scrollBottom = this.rows - 1; @@ -2173,7 +2172,6 @@ Terminal.prototype.index = function() { this.y--; this.scroll(); } - this.state = normal; }; @@ -2195,7 +2193,6 @@ Terminal.prototype.reverseIndex = function() { } else { this.y--; } - this.state = normal; }; @@ -2218,7 +2215,6 @@ Terminal.prototype.reset = function() { */ Terminal.prototype.tabSet = function() { this.tabs[this.x] = true; - this.state = normal; }; -- 2.39.5