File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -28,15 +28,16 @@ async function main() {
2828 }
2929
3030 const dashIndex = process . argv . indexOf ( '--' ) ;
31- // When PowerShell shims drop the literal '--', fall back to treating
32- // everything after "complete" as the completion payload.
31+ // PowerShell's argument parsing can normalize or drop a `--`
32+ // our "<pm> complete -- <query>" POSIX-style contract doesn't work the same way.
33+ // so we need to handle the PowerShell case separately.
34+ // gh issue discussion: https://github.com/bombshell-dev/tab/issues/82
35+
3336 const completionArgs =
34- // POSIX or already-present separator
3537 dashIndex !== - 1 && ( ! isPowerShell || dashIndex < process . argv . length - 1 )
3638 ? process . argv . slice ( dashIndex + 1 )
3739 : isPowerShell
38- ? // PowerShell shims may drop the first '--' and leave only a trailing one
39- args . slice ( 2 )
40+ ? args . slice ( 2 )
4041 : null ;
4142
4243 if ( ! completionArgs ) {
You can’t perform that action at this time.
0 commit comments