From e14d6775d80852e977cc1535706229da9f17e6bb Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 20 Feb 2025 13:23:23 -0800 Subject: [PATCH] Fix suggest exception when moving cursor in terminal Fixes #241394 --- .../terminalContrib/suggest/browser/terminalSuggestAddon.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts b/src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts index 9d9eeb3b58b..77010a1a383 100644 --- a/src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts +++ b/src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts @@ -463,7 +463,7 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest // requested, but since extensions are expected to allow the client-side to filter, they are // only invalidated when whitespace is encountered. if (this._currentPromptInputState && this._currentPromptInputState.cursorIndex < this._leadingLineContent.length) { - if (this._currentPromptInputState.cursorIndex <= 0 || this._currentPromptInputState.value[this._currentPromptInputState.cursorIndex].match(/[\\\/\s]/)) { + if (this._currentPromptInputState.cursorIndex <= 0 || this._currentPromptInputState.value[this._currentPromptInputState.cursorIndex]?.match(/[\\\/\s]/)) { this.hideSuggestWidget(false); return; }