Skip to content

Better way to handle completion options #18963

@MartinGC94

Description

@MartinGC94

Summary of the new feature / enhancement

There are several user requests to provide tab completion options for various things. Examples include:
#16747
#3118
#10064
#14337

Tab completion already includes a couple of options like [bool] RelativePaths and [bool]IgnoreHiddenShares but the current way to set such options is hard to discover and inconvenient to change on the fly.
For people that don't know, you need to modify the TabExpansion2 so both CompleteInput method calls use a hashtable with all the desired options set. There is an options parameter but if you try to set the default value there it gets ignored when you call TabExpansion2 with your tab key.

Proposed technical implementation details (optional)

Add a new variable similar to $PSStyle that contains all tabexpansion options, it could be called $PSTabExpansionOptions.
Another option would be to add 2 commands: Get-TabExpansionOption and Set-TabExpansionOption.

Metadata

Metadata

Assignees

No one assigned

    Labels

    In-PRIndicates that a PR is out for the issueIssue-Enhancementthe issue is more of a feature request than a bugNeeds-TriageThe issue is new and needs to be triaged by a work group.WG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions