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

Consider removing the setting of PATH_DIRS from the completion module #1876

Open
michaelpj opened this issue Dec 17, 2020 · 3 comments
Open

Comments

@michaelpj
Copy link

Description

PATH_DIRS can make completion very slow depending on your PATH (>10s). It is instant without it, and the PATH_DIRS feature doesn't seem so great.

I observed this for a while in executable completions, and eventually I just did a commenting-out bisection on the completion module and tracked it down to PATH_DIRS. It seems there is some limited discussion of this on the zsh list.

Expected behavior

Executable completions are fast!

Actual behavior

Steps to Reproduce

I'm not entirely sure what about my PATH triggers this. Removing entries speeds it up, but it might also be something to do with the size of the parent directories, I'm not totally sure what PATH_DIRS does.

Versions

  • Prezto commit: e915c34
  • ZSH version: 5.8
  • OS information:
@indrajitr
Copy link
Collaborator

Hi @michaelpj,

Does it help if you set the completion style accept-exact-dirs as mentioned here?

You can apply it as so:

zstyle ':completion:*:default' accept-exact-dirs true

@michaelpj
Copy link
Author

I can't reproduce this any more! I accidentally wiped out my change to not set PATH_DIRS and I didn't even notice! So I really have not idea what's going on. Maybe one of the other people who thumbs-up-ed this can still reproduce?

@Javex
Copy link

Javex commented Jul 23, 2023

I have this issue running in WSL2, it seems the expansion of Windows paths is taking forever. Setting the above option does not work. I wouldn't expect it to, because I am doing a very basic command completion, e.g. pyth<TAB> so there's no exact path here.

On the other hand, unsetopt PATH_DIRS fixes the issue, so yeah it would be great to have an option to disable it. I wouldn't remove it outright, I assume those that don't find it slow prefer for expanded search options for better results.

Weirdly enough, it seems to be the test whether a result is a directory (/ glob qualifier) that causes the slowness for me, but that's a discussion for zsh, not this repo.

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

3 participants