Skip to content

Commit ca10c3c

Browse files
committed
Prevent pwsh suggest when pasting
Fixes microsoft#210403
1 parent 98785f5 commit ca10c3c

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
@@ -452,7 +452,7 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
452452
}
453453

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

0 commit comments

Comments
 (0)