atuinsh / atuin

✨ Magical shell history
https://atuin.sh
MIT License
20.13k stars 543 forks source link

Bug: the installation command is not working for non posix shells #1659

Closed anki-code closed 7 months ago

anki-code commented 7 months ago

Hello! Thank you for atuin it's awesome!

Please fix the installation command on https://atuin.sh/ and in the repository:

bash <(curl --proto '=https' --tlsv1.2 -sSf https://setup.atuin.sh)
# xonsh: SyntaxError
# fish: Invalid redirection target

This syntax is not working on non POSIX shells like xonsh.

The right way to do this is run bash -c command e.g. https://brew.sh/:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Thanks!

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

akinomyoga commented 7 months ago

I suspect you have xonsh or fish installed with the name bash. If that is the case, I don't think that is a sane environment. All the Bash scripts with the shebang #!/usr/bin/env bash (which is the recent standard) are broken in such an environment. You may skip the processing of shebang by specifying -c, but I don't think that can be an essential solution.

ellie commented 7 months ago

I think it's more the issue that <(...blah) isn't supported in Fish and Xonsh. The install guide has a separate section for Fish

Just did a few tests and looks like

/bin/bash -c "$(curl --proto '=https' --tlsv1.2 -sSf https://setup.atuin.sh)"

does function the same way (wrt interactivity etc) on a few platforms

akinomyoga commented 7 months ago

Ah, OK. I now understand the issue. I'm sorry, but please forget about my comment above!

I'm not sure for Xonsh, but another solution is to use

curl --proto '=https' --tlsv1.2 -sSf https://setup.atuin.sh | bash
ellie commented 7 months ago

Hm, perhaps. I think /bin/bash -c is more likely to work on more systems/shells though, without relying on POSIX

In any case, I've updated atuin.sh! Thanks for the input everyone

anki-code commented 7 months ago

Thanks @ellie !

arcuru commented 7 months ago

Shouldn't it just be bash instead of /bin/bash? Bash doesn't necessarily have a required location, yes it's usually there but it's probably better to trust the users $PATH instead of hardcoding a location , that's why #!/usr/bin/env bash is the standard shebang instead of #!/bin/bash

Obviously this is not too important though, since any user can easily remove that.