volta
volta copied to clipboard
Volta completions not working for PowerShell 7 on Windows 11
I had added scripts generated by volta completions powershell to Microsoft.PowerShell_profile.ps1 but that not working.
Platform information:
- Windows 11: 22H2(22621.457)
- Powershell: 7.2.6
- Volta: 1.0.8
When you save the completion script, go in and change the $command variable to the below:
$command = @(
'volta'
for ($i = 1; $i -lt $commandElements.Count; $i++) {
$element = $commandElements[$i]
if ($element -isnot [StringConstantExpressionAst] -or
$element.StringConstantType -ne [StringConstantType]::BareWord -or
- $element.Value.StartsWith('-')) {
+ $element.Value.StartsWith('-') -or
+ $element.Value -eq $wordToComplete) {
break
}
$element.Value
}) -join ';'
This is most likely an issue with our upstream dependency on Clap, and will hopefully be resolved after we get to the latest version there (#1598).