Started getting "R encountered fatal error. The session was terminated." error when launching R Studio

is never going to work with my installation of the release version. Because

pkgutil --check-signature /Applications/RStudio.app

Package "RStudio":
   Status: package is invalid (checksum did not verify)

leading to

./RStudio.app
zsh: permission denied: ./RStudio.app

which could in theory be fixed by a deep dive into the directory tree looking for opportunities to chmod +x, but that's not something that anyone should be doing except on a spare box.

Elsepeth+360 is signed, but still not executable from shell, so diagnostics cannot be called with that command.

RStudio 2022.12.1+360 "Elsbeth Geranium" Release (974ce9490cc3e0e75855dbf216047027498ccc56, 2023-01-18) for macOS
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2022.12.1+360 Chrome/102.0.5005.167 Electron/19.1.3 Safari/537.36

Still stuck with this

install.packages("A3")
#> also installing the dependency 'pbapply'
#> Warning in system(paste0("tar zxf \"", path.expand(what), "\" -C \"",
#> path.expand(where), : error in running command
#> Warning: 'tar' returned non-zero exit code 127
#> Error: file '/var/folders/0j/3g7q2zss7fb55q5wqg9t141r0000gn/T//RtmpfQssIJ/downloaded_packages/pbapply_1.7-0.tgz' is not a macOS binary package
Sys.which("tar")
#> tar 
#>  ""
system("which tar")
#> Warning in system("which tar"): error in running command

Created on 2023-01-20 with reprex v2.0.2

The trouble is that I can't tell how RStudio is setting $PATH so I can't tell where to fix it.

See my workaround.