merge ParserTerminal with InputHandler

- quick'n dirty merge of classes - ParserTerminal is subclass of InputHandler
- basic fallback handlers implemented
- test regressions due to multiple changes in EscapeSequenceParser
- runtime down to 2.3s
- TODO: fix tests, implement DCS functions, full merge of classes
This commit is contained in:
Jörg Breitbart
2018-04-29 19:10:47 +02:00
parent 9d2bbd199c
commit 2d77fcf2fb
3 changed files with 193 additions and 137 deletions
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -4,7 +4,7 @@
* @license MIT
*/
import { CharData, IInputHandler, IInputHandlingTerminal } from './Types';
import { CharData, IInputHandler } from './Types';
import { C0 } from './EscapeSequences';
import { DEFAULT_CHARSET } from './Charsets';
import { CHAR_DATA_CHAR_INDEX, CHAR_DATA_WIDTH_INDEX } from './Buffer';
@@ -19,7 +19,7 @@ import { wcwidth } from './CharWidth';
* each function's header comment.
*/
export class InputHandler implements IInputHandler {
constructor(private _terminal: IInputHandlingTerminal) { }
constructor(protected _terminal: any) { }
public addChar(char: string, code: number): void {
// if (char >= ' ') {
+1 -1
View File
@@ -334,7 +334,7 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II
this._inputHandler = new InputHandler(this);
// this._parser = new Parser(this._inputHandler, this);
this._newParser = new ParserTerminal(this._inputHandler, this);
this._newParser = new ParserTerminal(this);
// Reuse renderer if the Terminal is being recreated via a reset call.
this.renderer = this.renderer || null;
this.selectionManager = this.selectionManager || null;