Skip to content
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

Provide the tab-completions of an alias' target command on the alias itself also when targeting native programs #21609

Open
mklement0 opened this issue May 6, 2024 · 0 comments
Labels
Issue-Enhancement the issue is more of a feature request than a bug Needs-Triage The issue is new and needs to be triaged by a work group.

Comments

@mklement0
Copy link
Contributor

Summary of the new feature / enhancement

An alias sensibly sees the same tab-completions as its target command, but, unfortunately and unexpectedly, only if the alias target is a PowerShell commands, and not also for external (native) programs.

  • For instance, defining Set-Alias gdt Get-Date makes Get-Date's tab-completions available on gdt calls too.

  • By contrast, say you've used Register-ArgumentCompleter to define completions for pwsh, and you've also defined Set-Alias psh pwsh; currently, psh unexpectedly does not use the tab-completions defined for pwsh.

This asymmetry should be fixed.

A minimal example:

# Define dummy completions for `pwsh`
Register-ArgumentCompleter -Native -CommandName pwsh -ScriptBlock { '-foo', '-bar' }

# Make `psh` an alias of `pwsh
Set-Alias psh pwsh  

psh - # pressing TAB right after the "-"  does NOT offer the -foo and -bar completions.

Proposed technical implementation details (optional)

No response

@mklement0 mklement0 added Issue-Enhancement the issue is more of a feature request than a bug Needs-Triage The issue is new and needs to be triaged by a work group. labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement the issue is more of a feature request than a bug Needs-Triage The issue is new and needs to be triaged by a work group.
Projects
None yet
Development

No branches or pull requests

1 participant