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

Using VScodeR terminal doesn't respect the local .Rprofile when parallel processes are launched

Open gowerc opened this issue 3 years ago • 4 comments

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 .Rprofile file that contains print("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 image

  • Top left box - shows example script to be executed
  • Bottom left box - shows our .Rprofile file 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

gowerc avatar Oct 26 '22 09:10 gowerc

Does it happen with R terminals not created in vscode?

renkun-ken avatar Oct 26 '22 11:10 renkun-ken

Nope:

image

  • 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)

gowerc avatar Oct 26 '22 11:10 gowerc

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Oct 27 '23 01:10 github-actions[bot]

Not stale

gowerc avatar Oct 27 '23 06:10 gowerc