You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Session Watcher never attaches on Windows 11 with R 4.6.1 + Radian 0.6.16 (.vsc.attach not found, "R: (not attached)") #1723
The R terminal starts correctly inside VS Code and all basic functionality appears to work (code execution, languageserver, httpgd, plotting, etc.), but the Session Watcher never attaches.
The status bar always shows:
R: (not attached)
Clicking it attempts to execute:
.vsc.attach()
which fails with
Error in .vsc.attach() :
could not find function ".vsc.attach"
As a consequence, the Global Environment pane never updates.
Environment
OS:
Windows 11 x64
VS Code:
1.128.0
Extension:
REditorSupport.r 2.8.8
R:
4.6.1 ("Happy Hop")
Console:
Radian 0.6.16
languageserver:
0.3.18
httpgd:
2.1.4
R terminal configuration
settings.json
{
"r.rterm.windows": "C:\\Users\\davellb\\AppData\\Local\\Python\\pythoncore-3.14-64\\Scripts\\radian.exe",
"r.rterm.option": [
"--no-save",
"--no-restore"
],
"r.bracketedPaste": true,
"r.sessionWatcher": true,
"r.alwaysUseActiveTerminal": true
}
What worksR terminal starts normallyRadian starts correctlyCode execution worksPlotting workslanguageserver workshttpgd worksObjects exist in the R sessionExample:example <- 123ls()
[1] "example"What does not workThe session never becomes attached.The status bar always remainsR: (not attached)The Global Environment pane stays empty.Clicking the status bar executes.vsc.attach()which returnsError in .vsc.attach() :could not find function ".vsc.attach"DiagnosticsThe VS Code environment variables are present.Sys.getenv("TERM_PROGRAM")returnsvscodeinteractive()returnsTRUESys.getenv("VSCODE_INIT_R")points toC:\\Users\\davellb\\.vscode\\extensions\\reditorsupport.r-2.8.8\\R\\session\\init.RThe startup hook appears to be installed correctly.identical(.First.sys, base::.First.sys)returnsFALSEPrinting .First.sys shows the VS Code replacement function, includingexports$.vsc.attach()However,search()never containstools:vscodeandexists(".vsc.attach")returnsFALSEAdditional informationI also createdC:\Users\<user>\.Rprofilecontainingif (interactive() && Sys.getenv("RSTUDIO") == "") {source(file.path(Sys.getenv("USERPROFILE"),".vscode-R",
"init.R"))}The file is sourced successfully, but the behavior does not change.It appears that .First.sys is successfully replaced, but the Session Watcher never completes initialization and .vsc.attach is never exported.
Activity
jbrekel commentedon Jul 15, 2026
Hi,
I think this is the same issue as reported at #1696.
I think the issue is that R doesn't call .First.sys automatically anymore.
Have you tried the fix mentioned here?
Perhaps my comment here might be of use?
Let me know if that helps anything.
leanhdung1994 commentedon Sep 18, 2026
The non-invasive solution by @Skolmeister works well for me: