Closed juliasilge closed 3 weeks ago
@jmcphers also thought that a regex was a bad idea and we should do the work of passing specific env vars by name. This tiny new helper now works like this:
.ps.rpc.get_env_vars(c("USER", "POSITRON", "POTATO"))
$USER
[1] "juliasilge"
$POSITRON
[1] "1"
$POTATO
[1] ""
So basically an unfancy and tiny wrapper around Sys.getenv()
.
I opened this issue to track a push-based model when the need becomes more urgent: https://github.com/posit-dev/positron/issues/4641
Addresses https://github.com/posit-dev/positron/issues/2723
With this new function (callable via
call_method()
in Positron) we can get the values for a set of environment variables starting with a given regex from the R process:If you need more than one set, you can do something like
.ps.rpc.get_env_vars("POSITRON|VSCODE")
.