diff --git a/src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts b/src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts index c31e0bce9a2..0a441f3cacc 100644 --- a/src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts +++ b/src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts @@ -184,12 +184,11 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest private _sync(promptInputState: IPromptInputModelState): void { const config = this._configurationService.getValue(terminalSuggestConfigSection); - if (!this._terminalSuggestWidgetVisibleContextKey.get()) { - // If input has been added - if (!this._mostRecentPromptInputState || promptInputState.cursorIndex > this._mostRecentPromptInputState.cursorIndex) { - let sent = false; - - // Quick suggestions + // If input has been added + let sent = false; + if (!this._mostRecentPromptInputState || promptInputState.cursorIndex > this._mostRecentPromptInputState.cursorIndex) { + // Quick suggestions + if (!this._terminalSuggestWidgetVisibleContextKey.get()) { if (config.quickSuggestions) { const completionPrefix = promptInputState.value.substring(0, promptInputState.cursorIndex); if (promptInputState.cursorIndex === 1 || completionPrefix.match(/([\s\[])[^\s]$/)) { @@ -201,14 +200,14 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest } } } + } - // Trigger characters - if (config.suggestOnTriggerCharacters && !sent) { - const lastChar = promptInputState.value.at(promptInputState.cursorIndex - 1); - if (lastChar?.match(/[\\\/\-]/)) { - this._requestCompletions(); - sent = true; - } + // Trigger characters - this happens even if the widget is showing + if (config.suggestOnTriggerCharacters && !sent) { + const lastChar = promptInputState.value.at(promptInputState.cursorIndex - 1); + if (lastChar?.match(/[\\\/\-]/)) { + this._requestCompletions(); + sent = true; } } }