From 510edaabb58dc9a3dd4f87efdf83662db6d01984 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Tue, 18 Jan 2022 22:12:24 +0100 Subject: [PATCH] Update streamProcessing.ts --- tabby-terminal/src/middleware/streamProcessing.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tabby-terminal/src/middleware/streamProcessing.ts b/tabby-terminal/src/middleware/streamProcessing.ts index 2c604949..e757f3ab 100644 --- a/tabby-terminal/src/middleware/streamProcessing.ts +++ b/tabby-terminal/src/middleware/streamProcessing.ts @@ -20,7 +20,7 @@ export interface StreamProcessingOptions { export class TerminalStreamProcessor extends SessionMiddleware { forceEcho = false - private inputReadline: ReadLine + private inputReadline: ReadLine|null = null private inputPromptVisible = false private inputReadlineInStream: Readable & Writable private inputReadlineOutStream: Readable & Writable @@ -99,7 +99,7 @@ export class TerminalStreamProcessor extends SessionMiddleware { } close (): void { - this.inputReadline.close() + this.inputReadline?.close() super.close() } @@ -126,7 +126,7 @@ export class TerminalStreamProcessor extends SessionMiddleware { private resetInputPrompt () { this.outputToTerminal.next(Buffer.from('\r\n')) - this.inputReadline.prompt(true) + this.inputReadline?.prompt(true) this.inputPromptVisible = true }