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

Nushell support #17221

Closed
1 task done
dougg0k opened this issue May 3, 2024 · 6 comments
Closed
1 task done

Nushell support #17221

dougg0k opened this issue May 3, 2024 · 6 comments
Labels
features New features outdated PR was locked due to age

Comments

@dougg0k
Copy link

dougg0k commented May 3, 2024

Verification

Provide a detailed description of the proposed feature

Add support for Nushell in the installation and completions.

What is the motivation for the feature?

Currently it does not work and the steps required are for bash/sh.

Here are installation examples of why this is necessary.

nu ❯ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
/bin/bash: line 1: #!/bin/bash: No such file or directory

nu ✗ bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
bash: line 1: #!/bin/bash: No such file or directory

However if I download the sh and execute with bash, the installation goes through.


But then, the last part of the installation are for sh based setup.

- Run these two commands in your terminal to add Homebrew to your PATH:
    (echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/user/.bashrc
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

Nushell does not have eval or at least if it does, does not work the same as bash.


Lastly, have completions support with it.

How will the feature be relevant to at least 90% of Homebrew users?

It will be based on the relevancy of the amount of nushell users. It will add more users to Homebrew, not help the current ones.

What alternatives to the feature have been considered?

None

@dougg0k dougg0k added the features New features label May 3, 2024
@Bo98
Copy link
Member

Bo98 commented May 3, 2024

Second part of your issue makes sense as a feature request - though we'd probably ask for a pull request to add it.

For the first part however, it seems like either nushell is mangling the curl output or you have an extremely buggy /bin/bash executable. In either case, you're not even getting to the bash-specific part: your shell is failing on basic POSIX shell syntax in that it can't even parse a shebang properly. This likely points to a bug outside of Homebrew.

@dougg0k
Copy link
Author

dougg0k commented May 3, 2024

That actually could be due to the expression $() not working with nushell, it's another thing that does not work like the other shells.

@dougg0k
Copy link
Author

dougg0k commented May 3, 2024

nushell/nushell#2812

https://www.nushell.sh/book/coming_from_bash.html

Workaround example for eval and $() https://www.nushell.sh/cookbook/ssh_agent.html#workarounds


It could require a reimplementation most likely. A file or at least steps specifically for nushell.

There should be a way to build a command just for nushell to download and install in one go. But the steps after would need to be different.


https://www.nushell.sh/book/how_nushell_code_gets_run.html

@Bo98
Copy link
Member

Bo98 commented May 3, 2024

We give instructions that work on all POSIX-compliant shells. The homepage would get very full if we started listing every non-compliant shell. Note how we don't have install instructions for PowerShell etc.

The shellenv instructions is a little different given we can detect the running shell and show the relevant message. We do support some non-POSIX shells there (since even POSIX shells can differ for this part) such as PowerShell so would be ok improving that part.

@dougg0k
Copy link
Author

dougg0k commented May 3, 2024

This would work on Nushell

curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | bash

or

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

@MikeMcQuaid MikeMcQuaid closed this as not planned Won't fix, can't repro, duplicate, stale May 6, 2024
@MikeMcQuaid
Copy link
Member

We're not going to change this for Nushell, sorry.

@github-actions github-actions bot added the outdated PR was locked due to age label Jun 6, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
features New features outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

3 participants