askpass
askpass copied to clipboard
askpass in RStudio when running knit cannot be made interactive with r_lib_interactive
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.
@gaborcsardi do you know if rlib_interactive changed?
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.
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.
@spgarbet Is it possible that you are using askpass 1.1 that does not use is_interactive()
?
> 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?
I would try installing a newer version of askpass, and set the rlib_interactive
option to TRUE
.
How do I install a newer version than 1.1.0?
https://github.com/r-lib/askpass/blob/main/DESCRIPTION#L4
Install the version on GitHub.
Did you click the link I just posted? The version on github is 1.1.0.
Also, I installed the source from github and was working from that when I posted the above snippet.
Right, never mind my comments then....