Repository navigation
Session watcher not attaching R and not showing plots #552
Description
Activity
What's your workspace folder in vscode remote-ssh session?
What's the value of
ls.str(.vsc)in your R session?After Remote-SSH-ing into the host, I clicked to open a folder, and selected my home directory, so I believe my workspace in this case is my home directory.
r$> ls.str(.vsc) attach : function () capture_str : function (object) check_null_dev : function () dataview_data_type : function (x) dataview_table : function (data) dir_extension : chr "/home/cmr46993/.vscode-R" dir_plot_history : chr "/tmp/RtmpJP79ua/vscode-R/images" dir_session : chr "/tmp/RtmpJP79ua/vscode-R" get_timestamp : function () globalenv_file : chr "/tmp/RtmpJP79ua/vscode-R/globalenv.json" globalenv_lock_file : chr "/tmp/RtmpJP79ua/vscode-R/globalenv.lock" homedir : chr "/home/cmr46993" inspect_env : function (env) new_plot : function () null_dev_id : Named int 2 null_dev_size : num [1:2] 10.1 10.1 path_to_uri : function (path) pid : int 175564 plot_file : chr "/tmp/RtmpJP79ua/vscode-R/plot.png" plot_history_file : NULL plot_lock_file : chr "/tmp/RtmpJP79ua/vscode-R/plot.lock" plot_updated : logi FALSE print.help_files_with_topic : function (h, ...) print.hsearch : function (x, ...) rebind : function (sym, value, ns) request : function (command, ...) request_browser : function (url, title, ..., viewer) request_file : chr "/home/cmr46993/.vscode-R/request.log" request_lock_file : chr "/home/cmr46993/.vscode-R/request.lock" rstudioapi_enabled : function () show_browser : function (url, title = url, ..., viewer = getOption("vsc.browser", "Active")) show_dataview : function (x, title, viewer = getOption("vsc.view", "Two")) show_globalenv : logi TRUE show_page_viewer : function (url, title = NULL, ..., viewer = getOption("vsc.page_viewer", "Active")) show_plot : logi TRUE show_view : logi TRUE show_viewer : function (url, title = NULL, ..., viewer = getOption("vsc.viewer", "Two")) show_webview : function (url, title, ..., viewer) tempdir : chr "/tmp/RtmpJP79ua" unbox : function (x) update_globalenv : function (...) update_plot : function (...) wd : chr "/home/cmr46993"As an alternative, I tried also right now: after Remote-SSH-ing into the host, I clicked to open a single R script, rather than a folder, but I still don't get R attached, and
ls.str(.vsc)looks the same.Hi @renkun-ken I think I've figured out the issue!!
As I said above, when I use
R: Create R TerminalI am able to view plots. I noticed that the plots are saved to:
/tmp/<random_id>/vscode-R/plot.pngHowever, 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:
- From VSCode in Windows 10, connect to linux host login node with Remote-SSH
- Open home directory ~/
- Open new terminal with VS Code
- Use srun to get an interactive compute node. 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.
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/tmpdirectory.Is there a way to change the tmp directory? For e.g., if I can put it in
$HOME/tmpthen 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 :)
Reacted by Adarsh Mathew, Gabriel Medeiros Abrahão and Zessi-CI'm myself just getting started using SSH in VSCode.
@radlinsky As an alternative to your statements:
- From VSCode in Windows 10, connect to linux host login node with Remote-SSH
and:
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.
Have you considered SSH'ing directly into the compute node with VSCode? Following: https://stackoverflow.com/a/66389686
Does that make any difference?This issue is stale because it has been open for 365 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Hi,
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.
Contents of ~/.Rprofile
Steps to Reproduce:
~/radianfrom Terminal pane (I do see my print statement 'this is my rprofile')plot(1:10, 1:10)I don't see a plot..vsc.attach()executed in radian, but no output.I can see plots if I run
R: Create R terminalbut 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:
Do you want to fix by self? (I hope your help!)
No thanks, I am not very experienced :)