diff --git a/src/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.ts b/src/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.ts index 657ad7663ee..c63e9cb5ead 100644 --- a/src/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.ts +++ b/src/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.ts @@ -416,7 +416,8 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest if (data === '\x7f') { if (this._additionalInput && this._additionalInput.length > 0 && this._cursorIndexDelta > 0) { handled = true; - this._additionalInput = this._additionalInput.substring(0, this._cursorIndexDelta - 1) + this._additionalInput.substring(this._cursorIndexDelta--); + this._additionalInput = this._additionalInput.substring(0, this._cursorIndexDelta - 1) + this._additionalInput.substring(this._cursorIndexDelta); + this._cursorIndexDelta-- handledCursorDelta--; } }