Sdkman-cli: Bug: .sdkmanrc is not loaded when opening a new terminal

Created on 16 Jul 2020  路  5Comments  路  Source: sdkman/sdkman-cli

Bug report

.sdkmanrc is loaded when I cd into a directory. Once there, if I open a new terminal in the same directory it is not loaded.
I'm using another similar tool (https://github.com/direnv/direnv) to export environment variables when _cd-ing_ into a directory and it works well when I open a new terminal. Not really sure how that tool or Sdkman detect this.

To reproduce

cd /tmp
mkdir foo   
cd foo
sdk env init
.sdkmanrc created.

cd .. && cd -

Using java version 8.0.252-open in this shell.

# Open a new terminal from the same directory (CTRL+SHIFT+T in Linux Mint)
# The new terminal is on the same directory but it doesn't load the env

Peek 2020-07-16 10-07

System info

  • Linux Mint 19.3
  • zsh 5.4.2 (x86_64-ubuntu-linux-gnu)
  • SDKMAN 5.8.3+506
bug

Most helpful comment

Thank you both for fixing and merging this so fast! 鉂わ笍

All 5 comments

Hi!

Indeed sdkman only reacts to cd'ing into a directory.

I guess Zsh may be able to hook into opening a new terminal and Bash will probably require another hack to simulate Zsh's behaviour 馃檮. I'll look into it.

Thanks for the quick reply. Happy to test any snapshot/beta version :-)

Dabbled a little bit around and it seems to be a one line fix. PR incoming!

This is now released as version 5.8.5. Thanks again for contributing @helpermethod

Thank you both for fixing and merging this so fast! 鉂わ笍

Was this page helpful?
0 / 5 - 0 ratings