Skip to content

Commit a2194e8

Browse files
authored
Merge pull request microsoft#210409 from microsoft/tyriar/210403
Prevent pwsh suggest when pasting
2 parents 714ce79 + ca10c3c commit a2194e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,10 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
379379
}
380380

381381
handleNonXtermData(data: string): void {
382-
this._handleTerminalInput(data);
382+
this._handleTerminalInput(data, true);
383383
}
384384

385-
private _handleTerminalInput(data: string): void {
385+
private _handleTerminalInput(data: string, nonUserInput?: boolean): void {
386386
if (!this._terminal || !this._enableWidget || !this._terminalSuggestWidgetVisibleContextKey.get()) {
387387
// HACK: Buffer any input to be evaluated when the completions come in, this is needed
388388
// because conpty may "render" the completion request after input characters that
@@ -456,7 +456,7 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
456456
}
457457

458458
// Hide and clear model if there are no more items
459-
if (!this._suggestWidget?.hasCompletions()) {
459+
if (!this._suggestWidget?.hasCompletions() || !nonUserInput) {
460460
this._additionalInput = undefined;
461461
this.hideSuggestWidget();
462462
// TODO: Don't request every time; refine completions

0 commit comments

Comments
 (0)