Skip to content

Commit 14a7dfa

Browse files
authored
don't dispose of addon on relaunch of terminal (microsoft#151139)
fix microsoft#146855
1 parent e3a2753 commit 14a7dfa

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
114114
if (this._commandDetectionListeners) {
115115
dispose(this._commandDetectionListeners);
116116
}
117+
this.clearDecorations();
118+
}
119+
120+
public clearDecorations(): void {
117121
this._placeholderDecoration?.dispose();
118122
this._placeholderDecoration?.marker.dispose();
119123
for (const value of this._decorations.values()) {

src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal {
258258
}
259259

260260
clearDecorations(): void {
261-
this._decorationAddon?.dispose();
262-
this._decorationAddon = undefined;
261+
this._decorationAddon?.clearDecorations();
263262
}
264263

265264
forceRefresh() {

0 commit comments

Comments
 (0)