Skip to content

Not working due to powershell's default behabior? #92

@so1ve

Description

@so1ve

My investigation revealed that PowerShell "swallows" double dashes. See npm/cli#3136 (comment).

Therefore, https://github.com/bombshell-dev/tab/blob/main/src/powershell.ts#L74 doesn't seem to work in practice, at least not during my local pnpm link development tests - argv doesn't receive the double dash at all.

I suggest modifying the code as follows, but not sure if this is the correct approach:

- $RequestComp = "& ${exec} complete -- $Arguments"
+ $QuotedArgs = ($Arguments -split ' ' | ForEach-Object { "'" + ($_ -replace "'", "''") + "'" }) -join ' '
+ __${name}_debug "QuotedArgs: $QuotedArgs"
+ $RequestComp = "& ${exec} complete '--' $QuotedArgs"

Here's the screenshot of process.argv.slice(2)

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions