Skip to content

PowerShell completion script broken with PS 7.3 #3312

Open
@pinkfloydx33

Description

Describe the bug

Beginning with PowerShell 7.3, the PowerShell argument completion script no longer works for empty commands (ie. command <tab> or command subcommand <tab>).

Auto complete only works if you begin to type at least one character of the next "phrase" (ie. command s<tab>)

Steps to reproduce

From a PowerShell 7.3 command line, type the following:

flux <tab> # nothing happens! 

Or

flux suspend <tab> # nothing happens! 

Expected behavior

The commands auto-complete:

flux <tab> # auto-completes 'bootstrap' 

Or

flux suspend <tab> # auto-completes 'alerts' 

Screenshots and recordings

No response

OS / Distro

N/A

Flux version

0.36.0

Flux check

N/A

Git provider

No response

Container Registry provider

No response

Additional context

This is actually an issue in the cobra library. It is due to changes in PS 7.3 that corrected a long standing bug in native command argument passing and quoting. Cobra generates a work-around that escapes the quotes surrounding the empty command. In the new default argument passing mode this is invalid.

I have opened an issue there

I originally thought this was an issue with the individual CLI tools I was using and I meant to open the issue here in the Flux repo. However, I dug into the Flux source and discovered the referenced cobra library is what is generating the script.

I figured I'd open the issue here anyways so others don't waste their time, and as a tracking issue to monitor the external library (albeit, likely low priority).

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Assignees

No one assigned

    Labels

    blocked/upstreamBlocked by an upstream dependency or issuebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions