sdkman / sdkman-cli

The SDKMAN! Command Line Interface
https://sdkman.io
Apache License 2.0
6.08k stars 629 forks source link

Bug: sdkman under fish freezes output #1225

Closed teras closed 1 year ago

teras commented 1 year ago

Bug report When I use fish as my shell, sdkman seems not to be able to refresh the display. The command runs, but won't update the display. It looks as if the output is stored in a temporary place, and is displayed only when the command exits. This wouldn't be a problem , until a command that needs user input is required. Then the system waits for the user input, but the user doesn't know that he has to type at all, waiting there forever.

To reproduce

When in fish shell, type any sdk command that needs user input. I.e if java 20.0.1.fx-zulu is not installed, a command like sdk install java 20.0.1.fx-zulu. If you let it rest a bit and then type [ENTER] all output is displayed at once and you see that the reason of waiting was this line;

Do you want java 20.0.1.fx-zulu to be set as default? (Y/n):

System info

Linux aura 6.1.39-1-lts #1 SMP PREEMPT_DYNAMIC Wed, 19 Jul 2023 17:58:31 +0000 x86_64 GNU/Linux

fish, version 3.6.1

SDKMAN! script: 5.18.2 native: 0.2.9

helpermethod commented 1 year ago

Hi @teras!

We don't officially support fish (yet), but there is a community-driven project which enables the use of SDKMAN! with fish

https://github.com/reitzig/sdkman-for-fish

teras commented 1 year ago

Hello @helpermethod and thank you for the fast reply.

The problem is not, that I can't use sdkman under fish. It works, I know these tools. I am actually using them. The problem is, as I noted, that sdkman somehow "buffers" the output under fish, and displays it only after sdkman exits.

I have the feeling that this should be a bug reported here, since it seems like a sdkman issue. If you prefer to move this bug report to https://github.com/reitzig/sdkman-for-fish of course I could do this.

helpermethod commented 1 year ago

It seems that fish's echo command buffers its output

https://stackoverflow.com/questions/27475097/why-does-fishs-echo-builtin-behave-differently-from-bashs-builtin