Skip to content

Commit

Permalink
Merge pull request microsoft#195188 from microsoft/tyriar/float_1
Browse files Browse the repository at this point in the history
Ensure terminal is not detached when clearing old input
  • Loading branch information
Tyriar authored Oct 13, 2023
2 parents d3c9c2c + 0301ad1 commit 648dbbe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/vs/workbench/contrib/terminal/browser/terminalEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ export class TerminalEditor extends EditorPane {

override clearInput(): void {
super.clearInput();
this._editorInput?.terminalInstance?.detachFromElement();
if (this._overflowGuardElement && this._editorInput?.terminalInstance?.domElement.parentElement === this._overflowGuardElement) {
this._editorInput.terminalInstance?.detachFromElement();
}
this._editorInput = undefined;
}

Expand Down Expand Up @@ -188,7 +190,11 @@ export class TerminalEditor extends EditorPane {
}

layout(dimension: dom.Dimension): void {
this._editorInput?.terminalInstance?.layout(dimension);
const instance = this._editorInput?.terminalInstance;
if (instance) {
instance.attachToElement(this._overflowGuardElement!);
instance.layout(dimension);
}
this._lastDimension = dimension;
}

Expand Down

0 comments on commit 648dbbe

Please sign in to comment.