Skip to content

Commit a4896a2

Browse files
Copilotmeganrogge
andauthored
Don't show suggest widget when shell tab completion has occurred (#252305)
* Initial plan for issue * Add tab key detection to prevent suggest widget after shell completion Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
1 parent ae60800 commit a4896a2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
414414
}
415415

416416
private _requestTriggerCharQuickSuggestCompletions(): boolean {
417-
if (!this._wasLastInputVerticalArrowKey()) {
417+
if (!this._wasLastInputVerticalArrowKey() && !this._wasLastInputTabKey()) {
418418
// Only request on trigger character when it's a regular input, or on an arrow if the widget
419419
// is already visible
420420
if (!this._wasLastInputIncludedEscape() || this._terminalSuggestWidgetVisibleContextKey.get()) {
@@ -447,6 +447,10 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
447447
return !!this._lastUserData?.match(/^\x1b[\[O]?[A-D]$/);
448448
}
449449

450+
private _wasLastInputTabKey(): boolean {
451+
return this._lastUserData === '\t';
452+
}
453+
450454
private _sync(promptInputState: IPromptInputModelState): void {
451455
const config = this._configurationService.getValue<ITerminalSuggestConfiguration>(terminalSuggestConfigSection);
452456
{

0 commit comments

Comments
 (0)