Skip to content

Commit 47f0397

Browse files
committed
update
1 parent 839464a commit 47f0397

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

bin/cli.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)