rstudio / renv

renv: Project environments for R.
https://rstudio.github.io/renv/
MIT License
997 stars 152 forks source link

renv running hidden restore() #1879

Closed brenktt closed 4 months ago

brenktt commented 4 months ago

I have an issue when cloning repos which are using renv to store package versions.

When I clone the repo and open the RStudio session I get following output in the console:

R version 4.2.1 (2022-06-23) -- "Funny-Looking Kid"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

- Project '~/renv_test' loaded. [renv 1.0.7]
- None of the packages recorded in the lockfile are currently installed.

Now when I try to run any code I get something like this:

renv::status() 
- Unrecognized response: please enter 'y' or 'n', or type Ctrl + C to cancel.
- Would you like to restore the project library? [y/N]:

It seems that somewhere in the background renv::restore() happens without being printed in the console. I suspect this because when I start typing the code I get recommendation to provide y or N even though it does not make sense (see below). image

When I provide y the packages start updating.

I think this behavior is very confusing for the users as they start running code and for some reason it does not work. Would you mind looking at this issue?

Thanks.

kevinushey commented 4 months ago

Thanks for the bug report. Could you also confirm the version of RStudio you're using?