Skip to content

Commit

Permalink
dispose terminal hint decoration on config change (#214178)
Browse files Browse the repository at this point in the history
  • Loading branch information
meganrogge authored Jun 4, 2024
1 parent 8d662c8 commit 55fdf62
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,24 @@ export class TerminalInitialHintContribution extends Disposable implements ITerm
marker,
x: this._xterm.raw.buffer.active.cursorX + 1,
});
if (this._decoration) {
this._register(this._decoration);
}
}

this._register(this._xterm.raw.onKey(() => {
this._decoration?.dispose();
this._addon?.dispose();
this._register(this._xterm.raw.onKey(() => this.dispose()));

this._register(this._configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration(TerminalInitialHintSettingId.Enabled) && !this._configurationService.getValue(TerminalInitialHintSettingId.Enabled)) {
this.dispose();
}
}));

const inputModel = commandDetectionCapability.promptInputModel;
if (inputModel) {
this._register(inputModel.onDidChangeInput(() => {
if (inputModel.value) {
this._decoration?.dispose();
this._addon?.dispose();
this.dispose();
}
}));
}
Expand Down

0 comments on commit 55fdf62

Please sign in to comment.