Skip to content

Nushell environment script (env.nu) is using the wrong string #4242

Closed

Description

@alluring-mushroom

Verification

Problem

I just installed rustup via curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

I use nushell, so when I next opened nushell it was very broken and both nushell/env.nu and nushell/config.nu contained source "$HOME/.cargo/env.nu

I fixed this with a source ~/.cargo/env.nu. You could equally use something like source ($nu.home-path | join .cargo/env.nu)`

cargo still couldn't be found, and I noticed the .cargo/env.nu was this:

if ("$HOME/.cargo/bin" not-in ($env.Path | split row (char esep))) {
  $env.Path = ($env.Path | prepend "$HOME/.cargo/bin")
}

Which resulted in a path of PATH=/home/user/$HOME/.cargo/bin:/home/user/.local/bin: ...

I haven't investigated what has caused this yet, but I would be happy to do so a bit later

Steps

  1. Prepare a system with nushell but not cargo
  2. Install cargo via rustip (curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh)
  3. Open nushell and observe its errors

Possible Solution(s)

I assume some string interpolation has changed somewhere?

Notes

No response

Rustup version

rustup 1.28.1 (f9edccde0 2025-03-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.87.0-nightly (b74da9613 2025-03-06)`

Installed toolchains

Default host: x86_64-unknown-linux-gnu
rustup home:  /home/user/.rustup

installed toolchains
--------------------
nightly-x86_64-unknown-linux-gnu (active, default)

active toolchain
----------------
name: nightly-x86_64-unknown-linux-gnu
active because: it's the default toolchain
installed targets:
  x86_64-unknown-linux-gnu

OS version

ubuntu 24.04

Activity

  1. rami3l commented on Mar 8, 2025

    @rami3l
    Member

    Will be closed by #4230.

  2. alluring-mushroom commented on Mar 8, 2025

    @alluring-mushroom
    Author

    I apologise, my searching wasn't successful it seems

  3. added this to the 1.28.2 milestone on Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions