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

Automatically re-hash shell commands after installing new tool version #446

Open
nirvana-msu opened this issue Jan 29, 2019 · 2 comments
Open
Assignees

Comments

@nirvana-msu
Copy link

nirvana-msu commented Jan 29, 2019

Steps to reproduce

  1. Install some tool using some other way (not through asdf)
  2. Run the tool. At this point bash will hash the full path to the executable (so that next time it will avoid searching $PATH)
  3. Install another version of the tool using asdf
  4. Set the version you want to use, e.g. asdf global <tool> x.y.z
  5. Run the tool.

Expected behavior

I would expect asdf shim to take over and execute the global version I've configured.

Actual behavior

Bash just takes the hashed executable path of the original tool, bypassing our shim. You can confirm this by running:

$ type <tool>
<tool> is hashed (/snap/bin/<tool>)

Environment

OS: Linux / Windows

asdf version:

0.6.3

Most other version managers clear hashes after installing a new version of the tool, e.g. you can see pyenv does it here.

It's simply a matter of running hash -r (for bash, at least) after the installation is complete. This can easily puzzle users who are not familiar with executable path hashing in bash.

P.S. Here is a nice stackoverflow answer explaining path hashing in bash.

@vic vic self-assigned this Jan 29, 2019
@jayvdb
Copy link

jayvdb commented Jan 31, 2019

Similar to #409

@Stratus3D
Copy link
Member

@nirvana-msu, is this similar enough to #409 that I can close this issue?

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

No branches or pull requests

4 participants