Repository navigation
Programmatic way to run "Attach External R Session"? #1872
Unanswered
katrinabrock
asked this question in
Q&A
Replies: 2 comments 2 replies
|
The R-side entry point is now Sys.getenv(c("SESS_ENDPOINT", "SESS_DISCOVERY_FILE"))
sess::connect()If both variables are empty, you need to pass the current window's endpoint explicitly. It doesn't discover an arbitrary VS Code window automatically. The copied |
0 replies
|
Workaround: run f <- Sys.glob("~/Library/Application Support/Code/User/globalStorage/reditorsupport.r/tmp/attach/vscode-r-*.R")
if (length(f)) source(f[which.max(file.mtime(f))])Script path: Lines 1226 to 1229 in e2b28f1 |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Previously, I used .vsc.attach() to connect the extension to a running session.
I see there is now a way to do this that involves running a vsc command and pasting: https://github.com/REditorSupport/vscode-R/wiki/Interacting-with-R-terminals#using-self-managed-r-terminals
I find the new way a bit cumbersome. Is there any way to do this programmatically directly from R? In particular, I use the R debugger extension and previously I could have those sessions automatically attach when they launch, but now it seems I'll have to manually run a key sequence each time I rerun my code and start the debugger. Is there any faster way?
EDIT: workaround
I was able to get "Attach to Debugger" down to one shortcut using the Commands Extension.
settings.json
keybindings.json
{ "key": "shift+cmd+a", "command": "R Custom: Attach to debugger", "when": "inDebugMode" }Would still be nice to have a way to call this from R.
All reactions