fix disposable leak (#290441)

fix #290219
This commit is contained in:
Megan Rogge
2026-01-26 12:20:33 -05:00
committed by GitHub
parent 1e6c35dde6
commit ff88862424

View File

@@ -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