vscode-R
vscode-R copied to clipboard
Global Environment Panel (Workspace) not updated after session restart
Let's say, I enter the code x <- 5
into the terminal, x
appears on the global environment / workspace panel:
When I now run following code in the terminal:
> startup::restart()
> x
Error: object 'x' not found
everything as expected so far, but even after manual refresh, the x
is still shown in the global environment / workspace panel.
For context, these are my settings related to R and terminal:
"r.alwaysUseActiveTerminal": true,
"r.bracketedPaste": true,
"r.plot.useHttpgd": true,
"r.plot.defaults.fullWindowMode": true,
"r.rpath.windows": "C:\\Program Files\\R\\R-4.2.1\\bin\\R.exe",
"r.rterm.windows": "C:\\Program Files\\R\\R-4.2.1\\bin\\x64\\Rterm.exe",
"terminal.integrated.defaultProfile.windows": "R Terminal",
"terminal.integrated.fontWeightBold": "normal",
"terminal.integrated.enableMultiLinePasteWarning": false,
"terminal.integrated.cursorStyle": "underline",
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.tabs.enabled": false,
I'm using latest vscode-R extension and languageserver package.
For reference to anyone who ends up working on this; it looks like startup::restart()
is essentially a wrapper around:
.Last <- function(x) { system2("R") }
quit("no")
Though it also has quite a bit of logic for handling different terminals and configurations (like preserving startup arguments as well as what to do if on Radian or Rstudio).
This is actually kind of tricky to deal with. It's been bothering me that the workspace doesn't disappear when closing the terminal, that turned out to be very straightforward (PR soon). However, restarting the session leads to funky results because the session watcher isn't aware that anything has happened
Edit: it doesn't seem like reg.finalizers are being called either? very weird Edit2: seems like the vscode Rprofile isn't being sourced only when using radian + startup::restart
This issue is stale because it has been open for 365 days with no activity.