Merge pull request #152136 from microsoft/tyriar/151228

Try prevent duplicate placeholder decorations showing
This commit is contained in:
Daniel Imms
2022-06-15 05:11:50 -07:00
committed by GitHub
2 changed files with 10 additions and 4 deletions

View File

@@ -297,6 +297,12 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
}
handleCommandStart(): void {
// Only update the column if the line has already been set
if (this._currentCommand.commandStartMarker?.line === this._terminal.buffer.active.cursorY) {
this._currentCommand.commandStartX = this._terminal.buffer.active.cursorX;
this._logService.debug('CommandDetectionCapability#handleCommandStart', this._currentCommand.commandStartX, this._currentCommand.commandStartMarker?.line);
return;
}
if (this._isWindowsPty) {
this._handleCommandStartWindows();
return;

View File

@@ -215,14 +215,14 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
if (!decoration) {
return undefined;
}
if (beforeCommandExecution) {
this._placeholderDecoration = decoration;
}
decoration.onRender(element => {
if (element.classList.contains(DecorationSelector.OverviewRuler)) {
return;
}
if (beforeCommandExecution && !this._placeholderDecoration) {
this._placeholderDecoration = decoration;
} else if (!this._decorations.get(decoration.marker.id)) {
if (!this._decorations.get(decoration.marker.id)) {
decoration.onDispose(() => this._decorations.delete(decoration.marker.id));
this._decorations.set(decoration.marker.id,
{