Skip to content

Commit 751a387

Browse files
authored
fix suggest bug when in selectionMode:never (microsoft#253887)
fix microsoft#253183
1 parent 81989af commit 751a387

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/vs/workbench/contrib/terminalContrib/suggest/browser/terminal.suggest.contribution.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@ registerActiveInstanceAction({
427427
keybinding: [{
428428
primary: KeyCode.Tab,
429429
// Tab is bound to other workbench keybindings that this needs to beat
430-
weight: KeybindingWeight.WorkbenchContrib + 2
430+
weight: KeybindingWeight.WorkbenchContrib + 2,
431+
when: ContextKeyExpr.and(SimpleSuggestContext.HasFocusedSuggestion)
431432
},
432433
{
433434
primary: KeyCode.Enter,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,8 +816,9 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
816816
if (!suggestion) {
817817
suggestion = this._suggestWidget?.getFocusedItem();
818818
}
819+
819820
const initialPromptInputState = this._mostRecentPromptInputState;
820-
if (!suggestion || !initialPromptInputState || this._leadingLineContent === undefined || !this._model) {
821+
if (!suggestion?.item || !initialPromptInputState || this._leadingLineContent === undefined || !this._model) {
821822
this._suggestTelemetry?.acceptCompletion(this._sessionId, undefined, this._mostRecentPromptInputState?.value);
822823
return;
823824
}

0 commit comments

Comments
 (0)