REditorSupport / REditorSupport/vscode-R
R terminal doesn't execute `~/.Rprofile` if renv is enabled and `RENV_CONFIG_USER_PROFILE=TRUE` is set in `~/.Renviron`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 139
- Avg merge
- 2h 46m
- Merged PRs (30d)
- 5
Description
Describe the bug
R doesn't execute ~/.Rprofile if renv is enabled and RENV_CONFIG_USER_PROFILE=TRUE is set in ~/.Renviron.
Background: renv is not supposed to source ~/.Rprofile by default, but this can be changed via RENV_CONFIG_USER_PROFILE environment variable.
To Reproduce
Steps to reproduce the behavior:
- Create an empty project with
renv::init() - Set
RENV_CONFIG_USER_PROFILE=TRUEin~/.Renviron. - Add some diagnostics code to
~/.Rprofile. E.g.,cat("hello\n"). - Open code session in the project directory.
- Open an R terminal for that project.
Can you fix this issue by yourself? (We appreciate the help)
No
Expected behavior
hello when a new R terminal is started
However, if you start R from terminal in the same directory you see hello.
- OS: macOS and linux
- VSCode Version: 1.82.1
- R Version: 4.3.0
- vscode-R version: 2.8.1
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
Reproduce the issue with ~/.Renviron setting RENV_CONFIG_USER_PROFILE=TRUE, ~/.Rprofile printing hello, an renv::init() project, and an R terminal. Start by tracing the R terminal startup entry point in the TypeScript extension and compare it with launching R directly; done means the terminal prints hello for the project without breaking normal startup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r, typescript, vscode
- Domain
- cli, developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100