Skip to content

Commit a307d64

Browse files
authored
Merge pull request microsoft#208524 from cpendery/fix/suggest-on-shell-completion
fix: suggest widget persisting on completion acceptance
2 parents 099c39e + 48262cd commit a307d64

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,12 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
425425
}
426426
// Right
427427
if (data === '\x1b[C') {
428-
handled = true;
429-
this._cursorIndexDelta += 1;
430-
handledCursorDelta++;
428+
// If right requests beyond where the completion was requested (potentially accepting a shell completion), hide
429+
if (this._additionalInput?.length !== this._cursorIndexDelta) {
430+
handled = true;
431+
this._cursorIndexDelta++;
432+
handledCursorDelta++;
433+
}
431434
}
432435
if (data.match(/^[a-z0-9]$/i)) {
433436

0 commit comments

Comments
 (0)