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

cd command is slow #479

Open
amorey opened this issue May 21, 2024 · 2 comments
Open

cd command is slow #479

amorey opened this issue May 21, 2024 · 2 comments

Comments

@amorey
Copy link

amorey commented May 21, 2024

Thanks for making such a useful tool!

I noticed that the cd command slowed down significantly after installing gvm and I tracked down the issue to this script: $GVM_ROOT/scripts/env/cd. I understand the need for overloading cd but it would be helpful if the function ran faster or alternatively if there was a way to opt-in or opt-out. In my case I'm just using the global go version and most of my use of cd is not go-related so the extra cycles aren't necessary.

Here's my setup:

zsh 5.9 (x86_64-apple-darwin23.0)
gvm v1.0.22
macOS 14.5
@irake99
Copy link

irake99 commented May 28, 2024

If you don't need go version auto-switching on cd, there is a workaround command unset cd to un-overloading cd.

You can put this command into ~/.bash_profile or ~/.zprofile.

@amorey
Copy link
Author

amorey commented May 29, 2024

Thanks! I had to add "-f" but this worked:

[[ -s "/path/to/home/.gvm/scripts/gvm" ]] && source "/path/to/home/.gvm/scripts/gvm"
unset -f cd

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