Sourcing an arbitrary script before running R/radian
See original GitHub issueIs your feature request related to a problem? Please describe.
On cluster-like machines, we usually don’t have a default R installation on the PATH on startup. Instead, we activate modules that load the desired versions of anything for each project before starting. So, if for example I wanted to use R 3.4.4 with the curl library 7.58 a common workflow is to source a project-specific shell script, for example load_R.sh
here:
#!/bin/bash
# load_R.sh contents
module load curl/7.58
module load R/3.4.4
and then proceed to start R or run Rscript. A similar case applies to e.g. conda environments in more common settings.
Apparently options such as r.rterm.linux
do some kind of check of whether it points to a “default” R wrapper script or something. So just prepending a source load_R.sh
leads to a "Cannot find R client at " error.
Describe the solution you’d like
I believe a good, simple solution would be to create an option e.g. r.rterm.sourcescript.linux
with a path to a shell file to be sourced before the R extension calls anything. This would allow a lot more fine tuning of the environment exclusively for the extension.
Describe alternatives you’ve considered
Although sourcing the script on .profile
or the like can be a workaround (although I was never able to make it work), it’s very messy since we don’t always want to source the same things in an R IDE-like setting, an interactive shell and a submission script.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
I did. What ended up fixing the issue, and actually solves the problem here in the first place, was this issue on vscode-remote-release.
The trick is to add an argument to the shell initialization via
terminal.integrated.shellArgs.linux
which runs an arbitrary command string that ends by invoking the shell again. So if anyone runs into this, just add whatever initialization stuff you need in place ofsource $HOME/load_R.sh
here.This issue was closed because it has been inactive for 14 days since being marked as stale.