REditorSupport / REditorSupport/vscode-R
`r.libPaths` is passed to `VSCR_LIB_PATHS` instead of the standard `R_LIB_PATHS`, which is not used by `R: Create R terminal` and `R: Attach Active Terminal`.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 139
- Avg merge
- 2h 46m
- Merged PRs (30d)
- 5
Description
I'm always frustrated when running R --no-save --no-restore from the integrated terminal has the different behavior from the extension commands R: Create R terminal and R: Attach Active Terminal (click R: not attach button in the bottom status bar).
Currently, the whole extension always uses process.env to access environment variables. However, these environment variables belongs to the vscode process, and are inherited from the parent process which launches vscode process. Multiple vscode instances inherit process.env from the first vscode instance if --user-data-dir is not used. This makes process.env clutter.
For example, if one use conda or nix, then to make vscode see all environment variables exported by conda or nix, one has to activate conda or nix in a shell, and then launch vscode from that shell. Otherwise, the conda and nix environment variables are not in process.env. Currently, vscode-R provide configurations r.rpath.linux and r.rterm.linux and r.libPaths. However, r.libPaths is passed to VSCR_LIB_PATHS instead of the standard R_LIB_PATHS which is not used by R: Create R terminal and R: Attach Active Terminal. I think it will better to pass r.libPaths configuration to the standard R_LIB_PATHS.
A better solution would be to detect conda environment and default.nix file and parse their environment variables. Then add these environment variables to vscode.ExtensionContext.environmentVariableCollection in the scope of current workspace.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the extension for r.libPaths, VSCR_LIB_PATHS, and the implementations of R: Create R terminal and R: Attach Active Terminal. First trace how the configuration reaches each terminal, then verify that the standard R_LIB_PATHS variable is used consistently; the issue is done when both commands honor r.libPaths like an R terminal launched directly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r, typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100