rustup icon indicating copy to clipboard operation
rustup copied to clipboard

Add support for tcsh shell

Open Rageoholic opened this issue 2 years ago • 2 comments

Problem

On FreeBSD, rustup will generate a .cargo/env that is sourced in .profile. There are two issues here.

  1. tcsh does not source .profile on run, it sources .login
  2. Manually sourcing .cargo/env will give a syntax error that too many arguments were given to case

Steps

  1. Install FreeBSD on a fresh machine with tcsh as the set shell (I used a VM)
  2. Install rustup using the given directions on the website
  3. You can either try to source .cargo/env or exit and reenter the shell
  4. Try running any rustup commands

Possible Solution(s)

  • Modify .cargo/env to not use BASH specific extensions (I wouldn't quite know what specific syntax you should be using)
  • Add sourcing .cargo/env to .login if present,

Notes

No response

Rustup version

Rustup 1.26.0

Installed toolchains

rustc 1.71.0

Rageoholic avatar Jul 22 '23 15:07 Rageoholic

rustup scatters a bunch of entries to source the env file, because we don't know what shell the user will be using (it may not be the one they installed with). We have some code that represents this and I don't think we have tcsh support - if you'd like to add that that would be great.

rbtcollins avatar Aug 13 '23 22:08 rbtcollins

AFAIK tcsh isn't even POSIX, so supporting that falls into the same category as supporting fish, meaning that:

  • The source suggestion is incorrect anyway (even worse than #3415) because the env file cannot be read by tcsh, which is more or less expected.
  • We need to add special cases one by one for each non-POSIX shell in the ideal case scenario, similar to what is done in #3108.

rami3l avatar Aug 18 '23 17:08 rami3l

@rustbot claim

cachebag avatar Aug 26 '25 16:08 cachebag

Hi @rami3l, @rbtcollins- I opened #4459

I was lurking this repo looking for a potential way to contribute to one of my favorite tools of my favorite language. This is my first PR of really any OSS project.

I hope I didn't step on any toes, I tried to stick as close to the original issue at hand as possible.

Let me know if perhaps there were any guidelines or procedures I should have followed first before opening this PR, or even if I did something completely wrong implementation wise. I'm eager to learn as much as I can before continuing to attempt to contribute elsewhere.

Thanks so much in advance.

cachebag avatar Aug 27 '25 00:08 cachebag