Using VScodeR terminal doesn't respect the local .Rprofile when parallel processes are launched
Describe the bug
If you launch parallel processes via the parallel package in the R terminal generated by "Create R Terminal" then the users .Rprofile file is not respected.
To Reproduce
- Create a empty directory
- Add a
.Rprofilefile that containsprint("hello world") - Load R terminal via "Create R terminal"
- Create parallel processes via
parallel::createCluster(2) - Notice that the "hello world" does not appear
- Run this instead via the terminal i.e.
Rscript -e 'parallel::makeCluster(2)'and notice that the "hello worlds" for the parallel processes do appear
Can you fix this issue by yourself? (We appreciate the help)
No
(If yes,) can we assist you with anything?
(If applicable) Please attach setting.json
Defaults, except:
"r.alwaysUseActiveTerminal": true,
"r.liveShare.defaults.shareWorkspace": false,
"r.lsp.promptToInstall": false,
"r.session.objectTimeout": 10,
Expected behavior
Expect that parallel sessions spawned within this terminal respect the users local .Rprofile (we depend heavily on it to setup libpaths.
Screenshots

- Top left box - shows example script to be executed
-
Bottom left box - shows our
.Rprofilefile printing "hi" - Top right box - shows us executing the script manually in an R terminal created by this extension
- Bottom right box - shows us executing the script via the terminal
Environment (please complete the following information):
Screenshot came from in house server but I was able to re-produce this on my local machine
- OS: MacOS Montery
- VSCode Version: 1.72.2
- R Version: 4.2.1
- vscode-R version: v2.6.0
Does it happen with R terminals not created in vscode?
Nope:

- Top left is code being manually stepped through
- Bottom left is .Rprofile
- Top right is a terminal created by "Create R Terminal" and then me manually stepping through the code (issue occours)
- Bottom right is a normal terminal where I launch R and then manually step through the code (issue does not occour)
This issue is stale because it has been open for 365 days with no activity.
Not stale