diff --git a/src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts b/src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts index b9f803936c9dd..987ab825b6c96 100644 --- a/src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts +++ b/src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts @@ -416,7 +416,7 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest } } // Left - if (data === '\x1b[D') { + else if (data === '\x1b[D') { // If left goes beyond where the completion was requested, hide if (this._cursorIndexDelta > 0) { handled = true; @@ -425,7 +425,7 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest } } // Right - if (data === '\x1b[C') { + else if (data === '\x1b[C') { // If right requests beyond where the completion was requested (potentially accepting a shell completion), hide if (this._additionalInput?.length !== this._cursorIndexDelta) { handled = true; @@ -433,6 +433,10 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest handledCursorDelta++; } } + // Other CSI sequence (ignore) + else if (data.match(/^\x1b\[.+[a-z@\^`{\|}~]$/i)) { + handled = true; + } if (data.match(/^[a-z0-9]$/i)) { // TODO: There is a race here where the completions may come through after new character presses because of conpty's rendering!