Skip to content

Commit

Permalink
feat(fuzzyhelp): improve browser opening behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
atusy committed Mar 28, 2024
1 parent 891c8d1 commit 6f95c4e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion R/fuzzyhelp.R
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,16 @@ fuzzyhelp_bg_view <- function(viewer) {
}

fuzzyhelp_bg_start <- function(app, server, viewer) {
# Setup browser
envvars <- Sys.getenv()
browser <- envvars["R_BROWSER"]
if (is.na(browser) || browser == "") {
browser2 <- getOption("browser")
if (is.character(browser2)) {
envvars["R_BROWSER"] <- browser2
}
}

writeLines("", .env$fuzzyhelp_url) # Ensure content is empty
callr::r_bg(
function(..., .env, base_viewer) {
Expand All @@ -473,7 +483,7 @@ fuzzyhelp_bg_start <- function(app, server, viewer) {
shiny::runGadget(..., viewer = viewer)
},
args = list(app = app, server = server, .env = .env, base_viewer = viewer),
env = Sys.getenv(),
env = envvars,
package = TRUE
)
}
Expand Down

0 comments on commit 6f95c4e

Please sign in to comment.