Skip to content

Native ArgumentCompleter not invoked for inputs that begin with hyphen (-) #2912

@AndrewGaspar

Description

@AndrewGaspar

Description

Because of this issue, it's not possible to provide completion for native command parameters.

Inputs that repro the issue for command 'foo' (i.e. do not invoke completion):

  1. foo -<tab>
  2. foo -a<tab>
  3. foo --<tab>

Inputs that do not repro the issue:

  1. foo --a<tab>
  2. foo ---<tab>

The issue repros with and without PSReadLine.

Steps to reproduce

  1. Register a new argument completer
    Register-ArgumentCompleter -Native -CommandName foo -ScriptBlock { "bar" }

  2. Type 'foo -<tab>'

Expected behavior

'foo -' completes to 'foo bar'

Actual behavior

The text does not change

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSRemotingProtocolVersion      2.3
CLRVersion
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
GitCommitId                    v6.0.0-alpha.14
PSVersion                      6.0.0-alpha
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSEdition                      Core
BuildVersion                   3.0.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Interactive-IntelliSensetab completion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions