-
-
Notifications
You must be signed in to change notification settings - Fork 632
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
Fish shell compatibility #671
Comments
If you'll forgive the plug, may I recommend sdkman-for-fish? A draft for showing it while installing SDKMAN! is here: sdkman/sdkman-hooks/pull/9 Given that a complete rewrite in Go is underway (which will make special support for different shells obsolete, I assume), I don't think we should expect much "official" support here. I'm sure @marc0der will check out pull requests for documentation? |
There's also omf-sdk for Oh My Fish users |
A default integration should be better 👍. Like @cesards proposes, I can propose.a contribution to support that if ok for you. With sdkman-for-fish, I have to install |
Any update on this issue ? |
I would also be interested in using sdkman with the fish shell. Is there a way of using sdkman with fish as of now? The sdkman-for-fish plugin sadly does not seem to work anymore. @reitzig mentioned that the rewrite in Go "will make special support for different shells obsolete". Though from what i can see sdkman does not use Go. Was the rewrite cancelled, has there been another rewrite? Is special support for different shell obsolete, in other words, does sdkman work with every shell out-of-the box some way, as implied by the reitzigs comment? |
While I should definitely push an update at some point, it still works for me. If you could leave your issue over in my repo, I'd appreciate it.
There hasn't been, and to my knowledge, there isn't one planned. As of now, sdkman is a Bash application manipulating environment variables, which means you'll need some form of wrapper to make it work in other shells. |
Thank you for the info. I just looked into setting up sdkman-for-fish again, the project does indeed work. Sorry for that, my bad. I assumed the installation was broken when I saw the last commit to the repo being from 2020 and sdkman-for-fish prompting that sdkman could not be found, even though I had previously installed it. sdkman-for-fish did successfully locate sdkman when I answered the prompt "sdkman could not be found, do you want to install it" with yes. |
Thanks, glad it worked out! Did you run afoul of reitzig/sdkman-for-fish#34, by any chance? If not, I'd be interested in the specifics of your setup. sdkman-for-fish is definitely supposed to find sdkman (at the default location, as of now)! |
It was like this for me:
A few days later, when you mentioned that sdkman-for-fish was still working for you, I attempted the installation again. This time, when sdkman-for-fish prompted me that sdkman could not be found and whether I wanted to install sdkman, I entered After I entered So not a real issue here, just a confusion on my part. Oh, and thank you for your quick response. |
Hi guys, I am missing official support for the fish shell |
Hi @ibqn, since the whole of SDKMAN is currently written in bash, it is not possible to officially support fish shell. |
In case it's helpful to anyone, I added this function to my fish config (
and this which adds your candidates to
Doing this, most of the |
@dmikusa-pivotal Thx for sharing, works like a charm. I changed to $HOME for compatibilty
|
Has anyone found a solution to make |
Long due an update, but |
Thanks for the comments above, very helpful. I was getting this error on adding the path: fish_add_path (find ~/.sdkman/candidates/*/current/bin -maxdepth 0)
fish: No matches for wildcard '~/.sdkman/candidates/*/current/bin'. See `help wildcards-globbing`.
find ~/.sdkman/candidates/*/current/bin -maxdepth 0
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
in command substitution
fish: Unknown error while evaluating command substitution
fish_add_path (find ~/.sdkman/candidates/*/current/bin -maxdepth 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ And I had an empty Install SDK Man with official instructions: curl -s "https://get.sdkman.io" | bash # vim ~/.config/fish/functions/sdk.fish:
function sdk
bash -c "source '$HOME/.sdkman/bin/sdkman-init.sh'; sdk $argv[1..]"
end # install a version of Java
sdk install java 17.0.2-open
# Set it as default
sdk default java 17.0.2-open
Then this worked, and I had to add this to config.fish to make it persistent across shells: fish_add_path (find "~/.sdkman/candidates/*/current/bin" -maxdepth 0) |
in order for
to work replace * with the actual package,
also replace ~ with $HOME $HOME represents ~ , i.e, home/user |
Thank you for the tip. This saves me hours of trying to do it myself. 🙏🏼 |
Please tick one:
It adds sdkman init snippet to bash and zsh, but I'm currently using Fish (I moved from ZSH a while ago) and it doesn't seem to support it.
I might try to create a PR with the right script for Fish shell if you agree on that. And it's a good way to start my Hacktoberfest!
The text was updated successfully, but these errors were encountered: