vscode-R: Unable to attach terminal with Google Drive (Drive File Stream)

I am using Windows 10 OS, and when I tried to use the session watcher, the R terminal cannot be attached. (neither auto attach or manually getOption('vscodeR')$attach())

I observed response.log was changing over time (as below), but obviously there was no attached R session or any expected window pop-up for dataview.


{"time":"2020-01-08 18:10:23","pid":7220,"command":"attach"} 
{"time":"2020-01-08 18:10:26","pid":7220,"command":"attach"} 
{"time":"2020-01-08 18:10:44","pid":7220,"command":"dataview","source":"table","type":"json","title":"mtcars","file":"C:\\Users\\kooho\\AppData\\Local\\Temp\\RtmpOKdp0S\\file1c3430431451.json"} 
{"time":"2020-01-08 18:10:49","pid":7220,"command":"attach"} 
{"time":"2020-01-08 18:15:47","pid":3172,"command":"attach"} 
{"time":"2020-01-08 18:19:31","pid":5868,"command":"attach"} 
{"time":"2020-01-08 18:19:34","pid":5868,"command":"attach"} 

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

@Koohoko Thanks for reporting!

It looks like init.R is correctly sourced in your .Rprofile but vscode-R does not manage to watch the response.log you refer to. The following cases may lead to such problem:

  1. You don’t launch R session with the vscode-R extension activated. Open an R file to activate the extension. If r.sessionWatcher is enabled, you’ll see a status item R: (not attached).
  2. The working directory of the R session and your workspace folder you open in VSCode is not the same. The session watcher requires that the session to be watched must be started in the workspace folder you open in VSCode as the working directory. It only watches {workspaceFolder}/.vscode/vscode-R/response.log. If user starts an R session in another directory (e.g. a subdirectory), the R session will create a response file like {workspaceFolder}/subfolder/.vscode/vscode-R/response.log, which does not work with vscode-R running in {workspaceFolder}.

If all above do not apply, would you like to post the output of the following command:

ls.str(getOption("vscodeR"))

and the path of your workspace folder you open in VSCode?

@andycraig Thanks for your comment, the updated version works just fine, but later I found out that my problem was caused by other wrong configurations.

@renkun-ken Thank you so much! The issue is fixed.

It turns out that it was indeed the inconsistent workspace that caused the problem. After putting the .Rprofile to my current directory (rather than the ~ folder) fixed the problem.

Thanks for your amazing work.