You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Installing R via rig from the project R-version warning makes it the default R outside RStudio #19229
When the project R-version warning bar (#12622, PR #18935) installs a missing R via the bundled rig, it runs rig add <version> --user. On a machine with no prior rig user-mode default, rig's add also calls set_default_if_none, which makes the new R the user's default R outside RStudio:
macOS: installs and loads ~/Library/LaunchAgents/io.r-lib.rig.rstudio-which-r.plist, which runs launchctl setenv RSTUDIO_WHICH_R <rig R> at every login. That overrides Desktop's own R lookup for every launch from the Dock/Finder, outlives RStudio, and clobbers a user's own launchctl setenv RSTUDIO_WHICH_R.
macOS/Linux: creates ~/.local/bin/R and ~/.local/bin/Rscript symlinks to the new R (shadowing e.g. Homebrew's R when ~/.local/bin is first on PATH), and points rig's Current/current link at it.
macOS/Linux: appends . "$HOME/.local/bin/rigenv" to .profile, .bash_profile, .bashrc, .zprofile and .zshrc whenever ~/.local/bin is not ahead of /usr/local/bin on rig's PATH.
The PR's intent was that a switch is not persisted on macOS/Linux (it lasts until RStudio quits), so none of this should happen. rig 0.11.0 has no flag or environment variable to opt out: the LaunchAgent is installed by rig default in user mode whenever /Applications/RStudio.app exists, and rig add sets a default when none exists yet.
Expected
Installing R from the warning bar should install that R and nothing else: no LaunchAgent, no R/Rscript quick links, no shell profile edits, no change to rig's user-mode default.
Plan
RStudio: run rig with ~/.local/bin first on its PATH (so it never edits shell profiles), snapshot rig's default-R artifacts before rig add and remove the ones the install created (LaunchAgent plus launchd RSTUDIO_WHICH_R, R/Rscript links, Current link).
rig: propose a rig add --no-default opt-out upstream and use it once a release bundles it.
Seen on a colleague's Mac after the switch installed R 4.3.3 (daily build with #18935).
Activity
e2e: install a missing R from the warning bar and check rig's default…
create rig's quick-link directory before a user-mode install
leave a link whose directory is gone alone; name the snapshot in the …
keep a rig user-mode install from becoming the default R outside RStu…
replace the powershell and tasklist call-outs with in-process routines
undo rig's Windows default after a user-mode install as well (#19233)
undo rig's RSTUDIO_WHICH_R in the gui launchd session (#19347)