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

askpass in RStudio when running knit cannot be made interactive with r_lib_interactive #9

Open
spgarbet opened this issue May 14, 2023 · 11 comments

Comments

@spgarbet
Copy link

spgarbet commented May 14, 2023

options(rlib_interactive = TRUE) no longer works to force it to be interactive. Similar to #3

I downloaded the code and put a browser() call at the beginning of is_interactive() and a cat statement and it's never called. I.e.

is_interactive <- function() {
  opt <- getOption("rlib_interactive")
  cat("YYAAAAABBAAA DABBA DOOO")
  browser()
  if (isTRUE(opt)) {
    TRUE

This is never called. Problem is verified on MacOS, and Ubuntu. We tried multiple versions and updates to no avail.

I suspect an RStudio update did something.

@jeroen
Copy link
Member

jeroen commented May 14, 2023

@gaborcsardi do you know if rlib_interactive changed?

@gaborcsardi
Copy link
Member

I don't really understand the question or what is going on, but FWIW I don't think RStudio does anything with the rlib_interactive option, it never did AFAIK. It is an option that you need to set for yourself, and it is intended for testing. Also, much of the tidyverse uses the rlang_interactive for this purpose.

@spgarbet
Copy link
Author

spgarbet commented May 14, 2023

The problem is that on current RStudio when running "knit" the popup never appears and it returns NULL. The documentation said to use options(rlib_interactive = TRUE) to work to force it to popup. This doesn't work. It did at some point in the past. I don't know what's changed, but it's broken at present.

The is_interactive call is never triggered is possibly part of the problem.

@gaborcsardi
Copy link
Member

@spgarbet Is it possible that you are using askpass 1.1 that does not use is_interactive()?

@spgarbet
Copy link
Author

> packageVersion("askpass")
[1] ‘1.1.0’

But the problem remains, how do I get it to make a popup when running knit from inside RStudio?

@gaborcsardi
Copy link
Member

I would try installing a newer version of askpass, and set the rlib_interactive option to TRUE.

@spgarbet
Copy link
Author

spgarbet commented May 14, 2023

How do I install a newer version than 1.1.0?

https://github.com/r-lib/askpass/blob/main/DESCRIPTION#L4

@gaborcsardi
Copy link
Member

Install the version on GitHub.

@spgarbet
Copy link
Author

Did you click the link I just posted? The version on github is 1.1.0.

@spgarbet
Copy link
Author

Also, I installed the source from github and was working from that when I posted the above snippet.

@gaborcsardi
Copy link
Member

Right, never mind my comments then....

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

No branches or pull requests

3 participants