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

Comments

Projects
None yet
5 participants
@mhalano
Copy link

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

This comment has been minimized.

Copy link
Collaborator

mcornella commented Dec 26, 2014

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

This comment has been minimized.

Copy link
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

This comment has been minimized.

Copy link
Collaborator

mcornella commented Dec 30, 2014

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

This comment has been minimized.

Copy link
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

This comment has been minimized.

Copy link
Contributor

apjanke commented Apr 1, 2015

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

@mhalano

This comment has been minimized.

Copy link
Author

mhalano commented Apr 1, 2015

@MightyCreak

This comment has been minimized.

Copy link

MightyCreak commented Jun 29, 2015

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

@Lyuuuu

This comment has been minimized.

Copy link

Lyuuuu commented Oct 24, 2016

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

@mcornella

This comment has been minimized.

Copy link
Collaborator

mcornella commented Oct 25, 2016

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

@mcornella mcornella closed this Oct 25, 2016

adamreese added a commit to adamreese/dotfiles that referenced this issue Jan 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.