Session watcher not attaching R and not showing plots
See original GitHub issueHi,
Thank you so much for your work, your vscode-R package is life changing 😃
I’m having issues with seeing plots (and help messages) in session watcher.
- VSCode Version: 1.52.1
- VSCode-R Version: v1.6.4
- OS Version: Windows 10
Contents of ~/.Rprofile
# [cmr46993@login4 ~]$ cat ~/.Rprofile
Sys.setenv(TERM_PROGRAM = "vscode")
source(file.path(Sys.getenv(
if (.Platform$OS.type == "windows") "USERPROFILE" else "HOME"),
".vscode-R", "init.R")
)
print("this is my rprofile")
Steps to Reproduce:
- From VSCode in Windows 10, connect to linux host with Remote-SSH
- Open home directory
~/
- Open new terminal with VS Code
- Activate conda environment where R and radian are installed
- Run
radian
from Terminal pane (I do see my print statement ‘this is my rprofile’) - If I run
plot(1:10, 1:10)
I don’t see a plot. - Click R: (not attached), I see
.vsc.attach()
executed in radian, but no output. - getOption(‘vscodeR’) returns NULL
- I manually copy paste my .Rprofile and nothing changes.
I can see plots if I run R: Create R terminal
but I would like to use my own managed session… any thoughts?
Here are my vscode settings:
{
"r.alwaysUseActiveTerminal": true,
"r.bracketedPaste": true,
"r.sessionWatcher": true,
"r.rterm.linux": "/home/cmr46993/.conda/envs/mygtx/bin/radian", //Use this only for Linux
"r.rpath.linux": "/home/cmr46993/.conda/envs/mygtx/bin/R",
// "r.rterm.windows": "/home/cmr46993/.conda/envs/mygtx/bin/radian", //Use this only for Linux
// "r.rpath.linux": "/home/cmr46993/.conda/envs/mygtx/bin/R",
"r.lsp.debug": true,
"r.lsp.diagnostics": true,
"r.rterm.option": [
"--no-save",
"--no-restore",
"--r-binary=/home/cmr46993/.conda/envs/mygtx/bin/R"
]
}
I see that the request.log is capturing something:
[cmr46993@login4 ~]$ cat ~/.vscode-R/request.log
{"time":"2021-02-09 18:26:08","pid":26320,"wd":"/home/cmr46993","command":"attach","tempdir":"/tmp/RtmpHWXKHB","plot":"Two"}
Do you want to fix by self? (I hope your help!)
No thanks, I am not very experienced 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Session Watcher does not show graphs · Issue #272 - GitHub
I do see a png for the graph stored in the PID folder within the .vscode/vscod-R folder though. So the problem seem to...
Read more >How to show R graph from visual studio code - Stack Overflow
Session watcher is cool and useful. Is it normal that plotting does not work when I open R terminal from inside bash in...
Read more >Writing R in VSCode: Interacting with an R session - Kun Ren
Looks like you did't enable r.sessionWatcher. You should set "r.sessionWatcher": true in vscode settings and reload vscode, then run command R: ...
Read more >Chapter 2 Base R Plotting Basics | Introduction to R for Natural ...
IMPORTANT NOTE: If you did not attend the sessions corresponding to Chapter 1, ... The graphics device is the area in which a...
Read more >Setting up R in Visual Studio Code · Markov Wanderer
Then make the following changes: enable R Bracketed Paste, R Session Watcher, and R: Always Use ActiveTerminal. Now we want to make plots...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @renkun-ken I think I’ve figured out the issue!!
As I said above, when I use
R: Create R Terminal
I am able to view plots. I noticed that the plots are saved to:/tmp/<random_id>/vscode-R/plot.png
However, I mistakenly left out a key step in how I was trying to use session viewer, I’ll rewrite it out bolding the missing step I forgot to mention I was doing:
The key here is that
login-node/tmp/
is different fromcompute-node/tmp/
My remote host is an HPC, so I don’t want to do heavy computational work on the login node. I want to use a compute node. I think what is happening is that r session watcher is still looking for vscode-r plots in
login-node/tmp/
but my plots are actually saved to thecompute-node/tmp
directory.Is there a way to change the tmp directory? For e.g., if I can put it in
$HOME/tmp
then I think this could solve my problem since $HOME is the same, whether I’m on a login or compute node?EDIT: indeed, I have confirmed that r session watcher works if I don’t get an interactive node 😃
This issue was closed because it has been inactive for 14 days since being marked as stale.