vscode-R icon indicating copy to clipboard operation
vscode-R copied to clipboard

R terminal doesn't execute `~/.Rprofile` if renv is enabled and `RENV_CONFIG_USER_PROFILE=TRUE` is set in `~/.Renviron`

Open idavydov opened this issue 9 months ago • 5 comments

Describe the bug R doesn't execute ~/.Rprofile if renv is enabled and RENV_CONFIG_USER_PROFILE=TRUE is set in ~/.Renviron.

Background: renv is not supposed to source ~/.Rprofile by default, but this can be changed via RENV_CONFIG_USER_PROFILE environment variable.

To Reproduce Steps to reproduce the behavior:

  1. Create an empty project with renv::init()
  2. Set RENV_CONFIG_USER_PROFILE=TRUE in ~/.Renviron.
  3. Add some diagnostics code to ~/.Rprofile. E.g., cat("hello\n").
  4. Open code session in the project directory.
  5. Open an R terminal for that project.

Can you fix this issue by yourself? (We appreciate the help)

No

Expected behavior hello when a new R terminal is started

However, if you start R from terminal in the same directory you see hello.

  • OS: macOS and linux
  • VSCode Version: 1.82.1
  • R Version: 4.3.0
  • vscode-R version: 2.8.1

idavydov avatar Sep 20 '23 09:09 idavydov