-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Better way to handle completion options #18963
Copy link
Copy link
Open
Labels
In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issueIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Metadata
Metadata
Assignees
Labels
In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issueIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
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] RelativePathsand[bool]IgnoreHiddenSharesbut 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
CompleteInputmethod calls use a hashtable with all the desired options set. There is anoptionsparameter 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
$PSStylethat contains all tabexpansion options, it could be called$PSTabExpansionOptions.Another option would be to add 2 commands:
Get-TabExpansionOptionandSet-TabExpansionOption.