From ed54d9a4831cac2193dc34fcdfb8abdd63fcaeee Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Fri, 5 Jul 2019 08:03:39 -0700 Subject: [PATCH] Allow tasks to attach virtual process to a terminal created on renderer --- src/vs/workbench/api/node/extHostTerminalService.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index 524cd7abb1e..744c0ca3c2c 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -337,6 +337,16 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { return terminal; } + public async attachVirtualProcessToTerminal(id: number, virtualProcess: vscode.TerminalVirtualProcess): Promise { + const terminal = this._getTerminalById(id); + if (!terminal) { + throw new Error(`Cannot resolve terminal with id ${id} for virtual process`); + } + const p = new ExtHostVirtualProcess(virtualProcess); + this._setupExtHostProcessListeners(id, p); + p.startSendingEvents(); + } + public createTerminalRenderer(name: string): vscode.TerminalRenderer { const terminal = new ExtHostTerminal(this._proxy, name); terminal._setProcessId(undefined);