Skip to content

Commit da7dc39

Browse files
authored
1 parent e26c4bc commit da7dc39

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/vs/workbench/contrib/terminal/browser/terminalGroup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ class SplitPaneContainer extends Disposable {
142142
if (index !== null) {
143143
this._children.splice(index, 1);
144144
this._splitView.removeView(index, Sizing.Distribute);
145+
instance.detachFromElement();
145146
}
146147
}
147148

src/vs/workbench/contrib/terminal/browser/terminalInstance.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -651,14 +651,10 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
651651
}
652652

653653
detachFromElement(): void {
654-
this._detachWrapperElement();
655-
this._wrapperElement = undefined;
654+
this._wrapperElement?.remove();
656655
this._container = undefined;
657656
}
658657

659-
private _detachWrapperElement() {
660-
this._wrapperElement?.parentNode?.removeChild(this._wrapperElement);
661-
}
662658

663659
attachToElement(container: HTMLElement): Promise<void> | void {
664660
// The container did not change, do nothing
@@ -679,7 +675,6 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
679675
}
680676

681677
// The container changed, reattach
682-
this._detachWrapperElement();
683678
this._container = container;
684679
this._container.appendChild(this._wrapperElement);
685680
setTimeout(() => this._initDragAndDrop(container));

0 commit comments

Comments
 (0)