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

New commands don't completing #3440

Closed
mhalano opened this issue Dec 26, 2014 · 9 comments
Closed

New commands don't completing #3440

mhalano opened this issue Dec 26, 2014 · 9 comments

Comments

@mhalano
Copy link
Contributor

mhalano commented Dec 26, 2014

Zsh is unable to complete new commands. Example: If I install (or purge) a package, I need to reload the shell (hit enter, ctrl-c, etc.).

@mcornella
Copy link
Member

That's a normal thing, not related to oh-my-zsh. The appropriate command to run once you've installed a new command is hash -rf. See http://unix.stackexchange.com/a/2180

@mhalano
Copy link
Contributor Author

mhalano commented Dec 27, 2014

I found the answer via zsh mailing list. 'hash -rf' is still not the
answer. The correct command is:

zstyle ':completion:*' rehash true

Why this option is not defined by default on oh-my-zsh?

@mcornella
Copy link
Member

That's a good question, I think it could be set. There could be a performance cost though [1] [2], but for the most part it will be fine.
We could add that line in lib/completion.zsh, care to submit a PR?

@mhalano
Copy link
Contributor Author

mhalano commented Dec 30, 2014

Already send the PR. Please let me know if PR is fine or not... Is my first
pull request for another project. :)

@apjanke
Copy link
Contributor

apjanke commented Apr 1, 2015

@mhalano Do you have a link to the Pull Request you made?

@mhalano
Copy link
Contributor Author

mhalano commented Apr 1, 2015

#3456

@MightyCreak
Copy link
Contributor

Tested the PR on my machine (Fedora 22), it works as expected! Please pull this request in master.

@Lyuuuu
Copy link

Lyuuuu commented Oct 24, 2016

after i install o-m-z,
zsh:command not found:npm(or node)

@mcornella
Copy link
Member

@MightyCreak we decided not to merge it because it could be a significant performance hit on systems with network drives in $PATH, and a setting wouldn't be a good solution since it's a oneline change and it can be added to zshrc as easily.

@Lyuuuu that seems to be a separate issue. If you just installed node or npm, just run rehash to refresh the commands from $PATH. If that's not the case or the solution doesn't work, you might have to change the $PATH in the zshrc file ($HOME/.zshrc). If it worked before have a look at PATH modifications in the rc file for your last shell; this will most commonly be $HOME/.bashrc or $HOME/.bash_profile.

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