Plot viewer not working with radian.
See original GitHub issueThe issue When I use radian as my default R Plots stubbornly use X11, rather than showing up in VSCode.
To Reproduce Steps to reproduce the behavior:
- Install languageserver package, then, vscode-R.
- Install radian (with
pip install -U radian
). - Set to use radian as R to use
"r.rterm.mac": "/usr/local/bin/radian"
- Run “R: Create R terminal” to attach an R (radian) session.
- Make a plot, e.g.
plot(c(1, 2, 3), c(1, 3, 2))
- The plot opens in X11 viewer, not inside VSCode.
If I repeat these steps from 3 on, but without setting radian as the rterm, then it works as expected (I get the PNG plot in the VSCode pane). How can I make this happen with radian too?
all my r setting.json
settings:
"r.alwaysUseActiveTerminal": true,
"r.bracketedPaste": true,
"r.rterm.mac": "/usr/local/bin/radian",
"r.sessionWatcher": true,
my ~/.Rprofile
is empty.
I have tried setting options(vsc.plot = TRUE)
or “Two” in ~/.Rprofile
, and also tried using httpgd (which is installed), by setting vsc.plot to FALSE, and adding "r.plot.useHttpgd": true,
to the settings json. In both cases it seems to work fine with vanilla R (I can use httpgd with the latter setting), but with radian, I just get the X11 window for plots.
Expected behavior I expect the plot to appear as a PNG (or SVG with httpgd) in VSCode.
Environment
- OS: macOS 12.1 (x86)
- VSCode Version: Version: 1.64.0
- R Version: 4.1.0
- vscode-R version: 2.3.6
Thanks for the really great extension! I just want to get the plots working (ideally with httpgd and radian).
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
If you start R from vscode terminal, then you need to follow https://github.com/REditorSupport/vscode-R/wiki/R-Session-watcher#advanced-usage-for-self-managed-r-sessions and put the following in your
~/.Rprofile
:I have moved to a new computer, with the following setup, and I do not have this problem anymore. The plots are now rendered in vscode, not X11, without me having to do anything.