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

Update set-java-home.zsh to check directory change #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rexk
Copy link

@rexk rexk commented Jul 7, 2020

Update set-java-home.zsh to only update if the working directory has changed.
This will prevent unnecessary java_home update.

Update set-java-home.zsh to only update if the working directory has changed.
This will prevent unnecessary java_home update.
@halcyon
Copy link
Owner

halcyon commented Jul 30, 2020

What if one changes JDKs but does not change the working directory? Why should JAVA_HOME not be updated in this case?

@sqtran
Copy link

sqtran commented Jul 30, 2020

This would most likely behave the same way as the bash script version. Workaround would be to just cd out and back in.

Reducing the # of times JAVA_HOME gets checked significantly reduces shell lag. I don't have a mac to see how zsh behaves, but the lag was very noticeable in bash before the latest update.

@halcyon
Copy link
Owner

halcyon commented Jul 30, 2020

This would most likely behave the same way as the bash script version. Workaround would be to just cd out and back in.

Reducing the # of times JAVA_HOME gets checked significantly reduces shell lag. I don't have a mac to see how zsh behaves, but the lag was very noticeable in bash before the latest update.

I find it just as concerning in the bash script version as I do in this one. Are you using Windows or Linux?

@sqtran
Copy link

sqtran commented Jul 30, 2020

This would most likely behave the same way as the bash script version. Workaround would be to just cd out and back in.
Reducing the # of times JAVA_HOME gets checked significantly reduces shell lag. I don't have a mac to see how zsh behaves, but the lag was very noticeable in bash before the latest update.

I find it just as concerning in the bash script version as I do in this one. Are you using Windows or Linux?

Linux. Verified the behavior exists on both Fedora 32 and RHEL 7.5.

@rexk
Copy link
Author

rexk commented Jul 30, 2020

@halcyon Perhaps we can set some another environment variable to notify if JDK as changed with asdf command.
So that we can short circuit the operation?

@halcyon
Copy link
Owner

halcyon commented Jul 31, 2020

@halcyon Perhaps we can set some another environment variable to notify if JDK as changed with asdf command.
So that we can short circuit the operation?

Sounds promising. I think @Johnny-Malizia is trying something along those lines in #106

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 this pull request may close these issues.

3 participants