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

Prioritize adding path to '.bash_profile' over '.profile'. #468

Closed
wants to merge 5 commits into from
Closed

Prioritize adding path to '.bash_profile' over '.profile'. #468

wants to merge 5 commits into from

Conversation

mlschneid
Copy link

If you use '.bash_profile' on osx, '.profile' gets ignored, which prevents the changes to $PATH from being picked up.

I don't have any experience in rust, so this code may not be idiomatic.

@Diggsey
Copy link
Contributor

Diggsey commented May 15, 2016

I'm not sure how far we should go down this road, but if we're going to do this, then IMO we should add the definition to both files, in the event that .bash_profile exists.

Based on the info here: http://hayne.net/MacDev/Notes/unixFAQ.html#shellStartup

It seems that bash looks for these files, in order: .bash_profile, .bash_login, .profile, and it will only read one of those files. If we always add it to .profile, and then add it to any additional .*_profile or .*_login files (I don't mean actually wildcard them, we list the possibilities exhaustively) then we ensure that each process gets its PATH set exactly once, regardless of whether it is a bash shell or not.

@mlschneid
Copy link
Author

I'm terrible at git and somehow smushed and flipped commits around, but all of it together should be the fix. I think it's a bit odd to have the filenames in the code, but I don't see a config file.

Before I do any more damage, I figured I should ask. Should I squash the commits?

@brson
Copy link
Contributor

brson commented May 17, 2016

Thanks for the patch.

Since there are several problems related to PATH config, I want to think a bit harder about this PATH situation before committing to more solutions. It also doesn't work on fish shell.

I previously switched from detecting the presense of *rc files and modifying them to just blanket modifying the .profile file whether it preexists or not. Now I'm leaning toward a maximal solution of just modifying every relevant startup file we know of.

@mlschneid
Copy link
Author

No sweat captain.

@mlschneid mlschneid closed this May 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants