rust-lang / rust-lang/rustup

Proposal: `rustup env <shell>` to source the `env.*` file automatically for a certain shell

Open
#4,128 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
22h 40m
Merged PRs (30d)
46

Description

Problem you are trying to solve

... say, I suddenly decided to start using nu but that happens after my last rustup self update. In this case I'll definitely end up without any env.nu and have to manually populate that file from the repo (we shouldn't assume that I can find that file that easily in the first place):

https://github.com/rust-lang/rustup/blob/178c502bfab89b68d7e2f2fa681e07ccef295656/src/cli/self_update/env.nu#L1-L3
https://github.com/rust-lang/rustup/issues/3639#issuecomment-2542661654

Solution you'd like

... if the user wants to add another shell to the mix, manually sourcing the corresponding env.* file will do, and it's usually just a single line in their *shrc file.
OTOH, if they want to source the env.* file automatically, rustup env <shell> would be perfect in terms of adding these sourcing scripts on demand.
https://github.com/rust-lang/rustup/issues/3639#issuecomment-2545551436

Notes

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing src/cli/self_update/env.nu and the linked discussion about generating shell-specific environment files. Define the behavior and supported-shell scope for rustup env , including what automatic sourcing should mean; done requires an agreed design and corresponding command behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.