From 7296cdf60dbadd0d065964e1115ea06d80e3ac7e Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Mon, 4 Aug 2025 13:10:37 -0500 Subject: [PATCH] Don't refresh files in positron Since it currently steals focus. --- R/utils.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index 3890c8d70..dadd0ba2f 100644 --- a/R/utils.R +++ b/R/utils.R @@ -37,7 +37,13 @@ rstudio_tickle <- function() { } rstudioapi::executeCommand("vcsRefresh") - rstudioapi::executeCommand("refreshFiles") + if (!is_positron()) { + rstudioapi::executeCommand("refreshFiles") + } +} + +is_positron <- function() { + nzchar(Sys.getenv("POSITRON", "")) } first_upper <- function(x) {