Merge pull request #211993 from microsoft/tyriar/pwsh5

Disable sending via CompletionCompleters for pwsh5
This commit is contained in:
Daniel Imms 2024-05-29 01:06:40 -07:00 committed by GitHub
commit d4b07e1cb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -203,7 +203,7 @@ function Send-Completions {
# `[` is included here as namespace commands are not included in CompleteCommand(''),
# additionally for some reason CompleteVariable('[') causes the prompt to clear and reprint
# multiple times
if ($completionPrefix.Contains(' ') -or $completionPrefix.Contains('[')) {
if ($completionPrefix.Contains(' ') -or $completionPrefix.Contains('[') -or $PSVersionTable.PSVersion -lt "6.0") {
$completions = TabExpansion2 -inputScript $completionPrefix -cursorColumn $cursorIndex
if ($null -ne $completions.CompletionMatches) {
$result += ";$($completions.ReplacementIndex);$($completions.ReplacementLength);$($cursorIndex);"