From 7d4402a81307f9743e6ead7fbbe0b473e8e8edaf Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 21 Jul 2021 10:46:51 -0700 Subject: [PATCH] Remove any from terminal editor split Part of #126387 Co-Authored-By: Megan Rogge --- .../contrib/terminal/browser/terminalEditorService.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalEditorService.ts b/src/vs/workbench/contrib/terminal/browser/terminalEditorService.ts index 8b633d0ca92..fe6eb042204 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalEditorService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalEditorService.ts @@ -73,7 +73,13 @@ export class TerminalEditorService extends Disposable implements ITerminalEditor // add any terminal editors created via the editor service split command const knownIds = this.instances.map(i => i.instanceId); const terminalEditors = this._getActiveTerminalEditors(); - const unknownEditor = terminalEditors.find(input => !knownIds.includes((input as any).terminalInstance.instanceId)); + const unknownEditor = terminalEditors.find(input => { + const inputId = input instanceof TerminalEditorInput ? input.terminalInstance?.instanceId : undefined; + if (inputId === undefined) { + return false; + } + return !knownIds.includes(inputId); + }); if (unknownEditor instanceof TerminalEditorInput && unknownEditor.terminalInstance) { this._editorInputs.set(unknownEditor.terminalInstance.resource.path, unknownEditor); this.instances.push(unknownEditor.terminalInstance);