From ff88862424ad32c8fe479dfbf95a3b7c64ea2854 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Mon, 26 Jan 2026 12:20:33 -0500 Subject: [PATCH] fix disposable leak (#290441) fix #290219 --- .../contrib/terminal/browser/chatTerminalCommandMirror.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.ts b/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.ts index 95908faac2f..60308557753 100644 --- a/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.ts +++ b/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.ts @@ -380,19 +380,22 @@ export class DetachedTerminalCommandMirror extends Disposable implements IDetach const colorProvider = { getBackgroundColor: (theme: IColorTheme) => getChatTerminalBackgroundColor(theme, this._contextKeyService) }; + const processInfo = new DetachedProcessInfo({ initialCwd: '' }); const detached = await this._terminalService.createDetachedTerminal({ cols: this._xtermTerminal.raw.cols ?? ChatTerminalMirrorMetrics.MirrorColCountFallback, rows: ChatTerminalMirrorMetrics.MirrorRowCount, readonly: false, - processInfo: new DetachedProcessInfo({ initialCwd: '' }), + processInfo, disableOverviewRuler: true, colorProvider }); if (this._store.isDisposed) { + processInfo.dispose(); detached.dispose(); throw new CancellationError(); } this._detachedTerminal = detached; + this._register(processInfo); this._register(detached); // Forward input from the mirror terminal to the source terminal