Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
RStudio doesn't respect environment variables set in .zshenv #6482
Steps to reproduce the problem
Describe the problem in detail
I have the following variables set in my
export R_USER="$XDG_CONFIG_HOME/R" export R_ENVIRON_USER="$XDG_CONFIG_HOME/R/Renviron" export R_PROFILE_USER="$XDG_CONFIG_HOME/R/Rprofile" export R_MAKEVARS_USER="$XDG_CONFIG_HOME/R/Makevars" export R_HISTFILE="$XDG_DATA_HOME/Rhistory" export R_LIBS_USER="$HOME/Library/R/3.6/library" export R_HISTSIZE=100000 export R_STARTUP_DEBUG=TRUE export MKL_NUM_THREADS=16 export OMP_NUM_THREADS=16
My rstudio shell preferences are set to
When running inside RStudio R console, I get:
Describe the behavior you expected
I expected them to have the same
When you said:
Does that mean you configured a custom shell under the terminal options, e.g.:
The setting in the Terminal tab does not impact how RStudio loads its R session, only how terminals in the Terminal tab get launched, so it is expected that what you describe would not cause the RStudio session to respect what is in
I'll leave this open at the moment so others more familiar with the overall R startup sequence than I am can comment.
Yes, I thought maybe it was a possibility that Rstudio got its env from a shell subprocess, but it makes sense that doesn't.
Regardless of that fact, it would make sense for user set variables to be recognized in Rstudio.