question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[session-watcher] Fail to start on remote

See original GitHub issue

Config:

  • Startup with custom R interpreter and project based .Rprofile
  • r.sessionwatcher enabled
# vscode
Sys.setenv(TERM_PROGRAM = "vscode")
source(file.path(Sys.getenv(if (.Platform$OS.type == "windows") "USERPROFILE" else "HOME"), ".vscode-R", "init.R"))

set in project root’s .Rprofile

I even added a cat() statement in ~/.vscode-R/init.R to track whether the code is being executed.

radian                                                                                                      
vscode session watcher: success
R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Platform: x86_64-pc-linux-gnu (64-bit)

However, the R session is still not attached in vscode. The same happens outside of the project (i.e. without a custom .Rprofile).

Running “R: Create R Terminal” errors - but so quickly that I cannot see the reason. I also cannot find a log for this.

More info

  • R_HOME = /opt/spack/opt/spack/linux-centos7-x86_64/gcc-9.2.0/r-3.6.1-j25wr6zcofibs2zfjwg37357rjj26lqb/rlib/R
  • radian v0.4.4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pat-scommented, Mar 20, 2020

It’s sourced because I can see the {renv} header after startup. I am calling the vscode lines after source("renv/activate.R") in the workspace root .Rprofile - could this mess things up?

Also

Sys.getenv("TERM_PROGRAM")    
[1] "vscode"

but yeah - the custom cat() output I added to init.R is missing here - hence it is not being executed (correctly).

Calling source(file.path(Sys.getenv(if (.Platform$OS.type == "windows") "USERPROFILE" else "HOME"), ".vscode-R", "init.R")) after startup attaches the session.

-> Turns out I have to call the vscode lines before source("renv/activate.R")

Thanks for helping - turns out its not related to an issue on your side but looks like renv is getting into the way somehow.

0reactions
github-actions[bot]commented, Jul 5, 2022

This issue was closed because it has been inactive for 14 days since being marked as stale.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[session-watcher] Fail to start on remote · Issue #259 - GitHub
Config: Startup with custom R interpreter and project based .Rprofile r.sessionwatcher enabled # vscode Sys.setenv(TERM_PROGRAM = "vscode") ...
Read more >
Unable to launch Remote Control Session - GoTo Community
Solved: I've run into an issue that started late last week where I am able to establish a connection to a remote computer...
Read more >
Writing R in VSCode: Interacting with an R session - Kun Ren
You should set "r.sessionWatcher": true in vscode settings and reload vscode, then run command R: Create R terminal, and it should work then....
Read more >
Connect devices through remote sessions - UWP applications
To create a remote session instance, you must start with a RemoteSystemSessionController object. Use the following framework to create a new ...
Read more >
10 Common Remote Start Issues at Batteries Plus
Find help with common remote start issues, how to fix it if your remote start isn't working and how to get your key...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found