-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better way to handle completion options #18963
Comments
👍 re centralizing tab-completion customizations in principle, but surfacing them (publicly) in PowerShell itself strikes me as the wrong place; instead, they should be surfaced via |
Is it conceivable we would ever get tab-completion for a subset of native commands? I find it slightly odd that Powershell cannot tab-complete for pwsh. Other candidates would be commands that cmdlets call down to, like the DISM cmdlets. If I use dism.exe, Powershell won't help by tab-completion, even though it knows (in a sense) how to. Hypothetically: |
@Andrew74L, providing tab-completion for an open-ended set of external CLIs is obviously impossible for PowerShell to provide itself (though you could argue that for Third-party, community-supported projects are the solution - see the posh-cli module (repository is here). |
Thanks Michael |
@mklement0 The problem with that approach is that every time a new option is added every interactive host author needs to update their app separately, and for editors that are no longer maintained (like ISE) you just lose the ability to set new options. |
Yes, the fact that you can update But I think that would be outweighed by the confusion that controlling the interactive experience in two distinct places, with different syntax would invite. |
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 anoptions
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
andSet-TabExpansionOption
.The text was updated successfully, but these errors were encountered: