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

Tab auto-complete regression #733

Closed
ExE-Boss opened this issue Jan 20, 2020 · 8 comments · Fixed by #741
Closed

Tab auto-complete regression #733

ExE-Boss opened this issue Jan 20, 2020 · 8 comments · Fixed by #741

Comments

@ExE-Boss
Copy link
Contributor

System Details

  • posh-git version: efed853
  • PowerShell version: v6.2.3

Issue Description

PR #711 caused a regression that broke tab completion on PowerShell >= 6, causing:

git <command> \t

To incorrectly expand to:

git <command> <command>

Instead of what it expanded to in commit 89dafc1, which is what I was forced to roll back to.

@rkeithhill
Copy link
Collaborator

rkeithhill commented Jan 20, 2020

What do you get from the built-in argument completion for cd ~; gci \w? And what do you get for git <command> .\t?

@rkeithhill
Copy link
Collaborator

Also, do you have a specific repro because I haven't been able to repro what you are seeing?

@eXpl0it3r
Copy link

Not sure if it's actually an regression, currently the new git command git switch <branch> doesn't work with tab-completion though.

@rkeithhill
Copy link
Collaborator

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.

@theaquamarine
Copy link
Collaborator

Would you be open to an update to 0.x that adds support for switch and restore?

@rkeithhill
Copy link
Collaborator

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.

@cdonnellytx
Copy link
Contributor

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.

@rkeithhill
Copy link
Collaborator

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants