-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
RStudio IDE not loading PATH
from shell
#13341
Comments
@jabenninghoff Thank you for raising the issue! Running RStudio from the GUI will only pick up global environment variables. To pick up the variables in However, I'll keep this open as an enhancement request to include |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions. |
This is still an issue. Thanks. |
IMHO, if we want to solve this, we should just start running the R session through a shell, rather than launching it directly. Our attempts to manually set the PATH in the same way a shell might have led to other problems. |
That's what I've needed to use as a workaround (run |
System details
Steps to reproduce the problem
.zshrc
that setsPATH
, like this zshrcDescribe the problem in detail
This issue is related to #10997 and #12529, but neither issue describes the whole problem in detail.
Looking at SessionPath.cpp:
/usr/local/bin
is inPATH
, RStudio was launched in a Terminal session. However,/usr/local/bin
is in/etc/paths
for every supported version of macOS, including Ventura. An alternative would be to look for/opt/homebrew/sbin
or/usr/local/sbin
(set by Homebrew in the shell, depending on architecture)./usr/local/bin
from/etc/paths
, the shellPATH
is not loaded, even thoughgrepl("(^|:)/usr/local/bin/?(:|$)", Sys.getenv("PATH"))
evaluates toFALSE
. I can't tell why this is, butSys.getenv("SHELL")
returns[1] "/bin/zsh"
(the default shell on newer versions of macOS including Ventura)initializePathViaShell
is never called andPATH
is set usinginitializePathViaEtcPaths
PATH=$SHELL -l -c 'printf "%s" "$PATH"'
generates a path that's different from what's in the Terminal (different order, doesn't include the full path)To recap:
/opt/homebrew/sbin
or/usr/local/sbin
, or just load the shellPATH
every time?initializePathViaShell
is called on a factory fresh system?-l
flag be removed from the call to the shell ininitializePathViaShell
?Default (factory fresh)
/etc/paths
:Setting path using
-l
:Describe the behavior you expected
PATH
set the same when RStudio is launched from either Terminal or GUI.Launched via Terminal (
open /Applications/Rstudio.app
):Launched via GUI:
The text was updated successfully, but these errors were encountered: