From 79965708abb5b8c98544d2e0d86646d59bc0a55e Mon Sep 17 00:00:00 2001 From: t-amqi Date: Mon, 24 Jul 2017 11:43:03 -0700 Subject: [PATCH 1/2] Add lineFeed event - this is useful for checking when a cmd is entered or when a cmd finishes - also handy to have for accessibility for output --- src/InputHandler.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/InputHandler.ts b/src/InputHandler.ts index 15d10c57f7..7cad6f09fc 100644 --- a/src/InputHandler.ts +++ b/src/InputHandler.ts @@ -132,6 +132,12 @@ export class InputHandler implements IInputHandler { if (this._terminal.buffer.x >= this._terminal.cols) { this._terminal.buffer.x--; } + /** + * This event is emitted whenever the terminal outputs a LF or NL. + * + * @event lineFeed + */ + this._terminal.emit('lineFeed'); } /** @@ -281,7 +287,7 @@ export class InputHandler implements IInputHandler { this._terminal.buffer.y = this._terminal.rows - 1; } this._terminal.buffer.x = 0; - }; + } /** @@ -299,7 +305,7 @@ export class InputHandler implements IInputHandler { this._terminal.buffer.y = 0; } this._terminal.buffer.x = 0; - }; + } /** @@ -1107,7 +1113,7 @@ export class InputHandler implements IInputHandler { this._terminal.cursorHidden = true; break; case 1049: // alt screen buffer cursor - ; // FALL-THROUGH + // FALL-THROUGH case 47: // normal screen buffer case 1047: // normal screen buffer - clearing it first // Ensure the selection manager has the correct buffer From 23dd3d7a67abad1cc3d5bf1167456cb57f4af27d Mon Sep 17 00:00:00 2001 From: t-amqi Date: Mon, 24 Jul 2017 13:41:24 -0700 Subject: [PATCH 2/2] Fix indentation --- src/InputHandler.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/InputHandler.ts b/src/InputHandler.ts index 7cad6f09fc..449a9399b9 100644 --- a/src/InputHandler.ts +++ b/src/InputHandler.ts @@ -132,11 +132,11 @@ export class InputHandler implements IInputHandler { if (this._terminal.buffer.x >= this._terminal.cols) { this._terminal.buffer.x--; } - /** - * This event is emitted whenever the terminal outputs a LF or NL. - * - * @event lineFeed - */ + /** + * This event is emitted whenever the terminal outputs a LF or NL. + * + * @event lineFeed + */ this._terminal.emit('lineFeed'); }