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

[Feature request] only display directories with tab completion #124

Open
glenncarr opened this issue Jul 26, 2021 · 5 comments
Open

[Feature request] only display directories with tab completion #124

glenncarr opened this issue Jul 26, 2021 · 5 comments

Comments

@glenncarr
Copy link

Like cd is it possible to have tab completion only display directories and not include files?

@glenncarr glenncarr changed the title Feature request: only display directories with tab completion [Feature request] only display directories with tab completion Jul 27, 2021
@mattcargile
Copy link

Are you using z + <TAB>? I've never seen it auto complete files. Maybe you can manually remove an entry by looking through output from z -l?

@glenncarr
Copy link
Author

Here's what I'm seeing:
zlocation-files

@mattcargile
Copy link

Oh I see what you mean now. I think there is a collision between the native PSReadline autocompletion and the z autocompletion. I usually don't begin my autocomplete with a PathSeparator and then I get the preferred behavior. When I began the autocompletion with a .\ then I think the PSReadLine autocompleter picks up.

Not sure how they could coexist or how to turn off the native autocompleter if user is using z.

@mattcargile
Copy link

mattcargile commented Jan 31, 2022

Could a solution be to Push-Location to the directory of the file? So there could be an added check of the string passed in and then Split-Path or the like to get the directory?

I also wonder if adding [ArgumentCompleter()] on the function itself instead of using Register-ArgumentCompleter would produce similar behavior. Looks like it is probably the exact same behavior.

I did more searching online digging into how the path autocompletion is working and I'm not sure if that is configurable. Maybe the Register-ArgumentCompleter could be used to pick up \s somehow to override the default behavior.

@mattcargile

This comment has been minimized.

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

No branches or pull requests

2 participants