Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RStudio New Project wizard opens duplicate sessions #2346

Closed
peymaneshghi opened this issue Apr 28, 2021 · 5 comments · Fixed by #2347
Closed

RStudio New Project wizard opens duplicate sessions #2346

peymaneshghi opened this issue Apr 28, 2021 · 5 comments · Fixed by #2347
Labels
feature a feature request or enhancement

Comments

@peymaneshghi
Copy link

When using RStudio's New Project wizard to create "R package using devtools", it always opens the package in duplicate sessions.
Perhaps the dcf uses create_package(), which has open = rlang::is_interactive() argument and it causes new session gets opened.

@peymaneshghi peymaneshghi added the feature a feature request or enhancement label Apr 28, 2021
@malcolmbarrett
Copy link
Contributor

I've had the same issue with custom project templates, and open was indeed the cause. I've had to wrap a helper function that set open = FALSE, then call that function in the project template DCF. However, it doesn't look like the "R package using devtools" template is in this package; is it in the IDE?

@malcolmbarrett
Copy link
Contributor

Yeah, I think this is actually an issue created in the IDE, so you might want to file this over there: https://github.com/rstudio/rstudio/blob/0899d13386fd5e61ec847cc62a6eb252702a5ebc/src/cpp/session/modules/SessionProjectTemplate.cpp#L580

@peymaneshghi
Copy link
Author

Thanks @malcolmbarrett
Yes but the IDE is calling the create() from devtools.

usethis::create_package(path, ...)

I can't see how that could be fixed at the IDE without providing a wrapper function from devtools with open = FALSE?

@jimhester
Copy link
Member

The only reason devtools::create() still exists is because the IDE uses it, so we could set open = FALSE as the default method in devtools::create(). I think most people will now use create_package() interactively.

@malcolmbarrett
Copy link
Contributor

Oh, well that sure makes it easy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants