Closed ExE-Boss closed 4 years ago
What do you get from the built-in argument completion for cd ~; gci \w
? And what do you get for git <command> .\t
?
Also, do you have a specific repro because I haven't been able to repro what you are seeing?
Not sure if it's actually an regression, currently the new git command git switch <branch>
doesn't work with tab-completion though.
If you git clone the repo, it has support for git switch. Has had it for a few months now. But we haven't published a new beta in almost a year and I'm not sure when the next beta will be published. I recommend that you git clone this repo and import the module by path.
Would you be open to an update to 0.x that adds support for switch and restore?
Yes and no. Obviously adding features to 0.x would help folks but I'd really like to "nudge" folks to 1.0. That said, 1.0 is still beta so that's hard to do until we release a stable version of v1. Supporting multiple versions is not ideal when we have such a small set of folks trying to maintain this module. Whining aside ;-), I would accept a PR to add that functionality to 0.x but who knows when a new version of 0.x would be published.
I dug into this a bit... the main issue is that the handler for Register-ArgumentCompleter
returns the "Text" for an autocomplete as git <command>
with no trailing space, instead of the expected git <command>
with at least one trailing space. The regexes in GitTabExpansionInternal
expect at least one space after the command.
An annoying side-effect of this is that Register-ArgumentCompleter
completions aren't unregistered if you unload the module, meaning debugging involves having to open a new PowerShell process for each attempt at debugging.
@cdonnellytx Thanks for taking the time to debug this. If Register-ArgumentCompleter
is removing the space between the command and the tab, then there's a challenge - how do we distinguish git checkout \t
from git che\t
? Perhaps the space still exists in one of arg completer params?
System Details
Issue Description
PR #711 caused a regression that broke tab completion on PowerShell >= 6, causing:
To incorrectly expand to:
Instead of what it expanded to in commit https://github.com/dahlbyk/posh-git/commit/89dafc1f37d9a44917d5ce6a84e889e54c6f98b9, which is what I was forced to roll back to.