Cannot connect to R prompt on Mac OSX Mojave

Error Information:

All of a sudden, without updating Rstudio, I noticed a prompt saying Rstudio can't connect to R. I checked with my teammates who also have the issue (with local Rstudio CE clients). Curiously, the issue disappears for one teammate when turning off their VPN connection (not true for everyone else).

Using nc I can verify the server Rstudiop expects to be running is indeed running. Though I do notice a reply to the browser re: erroneous argument?

nc -v 127.0.0.1 46990
found 0 associations
found 1 connections:
     1:	flags=82<CONNECTED,PREFERRED>
	outif lo0
	src 127.0.0.1 port 63565
	dst 127.0.0.1 port 46990
	rank info not available
	TCP aux info available

Connection to 127.0.0.1 port 46990 [tcp/*] succeeded!

Attempted steps taken to fix -

I went through the list here and was able to rule out each potential problem.

System Information:

  • RStudio Edition: Desktop
  • RStudio Version: 4.03
  • OS Version: Mac OS X
  • R Version: 1.3.1093 SHA-256 bdc4d3a4
  • Output your diagnostics report (if possible):

RStudio Diagnostics Report
==========================

WARNING: This report may contain sensitive security information and / or
personally identifiable information. Please audit the below and redact any
sensitive information before submitting your diagnostics report.

Generated: Mon Jan 11 08:29:51 2021

RStudio Version
--------------------------------------------------
1.3.1093


Session Information
--------------------------------------------------
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.0.3 tools_4.0.3   


System Information
--------------------------------------------------
sysname        : Darwin                                                                                          
release        : 18.7.0                                                                                          
version        : Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64
nodename       : ** redacted **                                                                      
machine        : x86_64                                                                                          
login          : statwonk                                                                                        
user           : statwonk                                                                                        
effective_user : statwonk                                                                                        


Platform Information
--------------------------------------------------
OS.type    : unix
file.sep   : /
dynlib.ext : .so
GUI        : X11
endian     : little
pkgType    : mac.binary
path.sep   : :
r_arch     : 


Environment Variables
--------------------------------------------------
_                                   : /Applications/RStudio.app/Contents/MacOS/RStudio
__CF_USER_TEXT_ENCODING             : 0x1F5:0x0:0x0
Apple_PubSub_Socket_Render          : /private/tmp/com.apple.launchd.jgoULVANLw/Render
CLICOLOR_FORCE                      : 1
COLORFGBG                           : 7;0
COLORTERM                           : truecolor
DYLD_FALLBACK_LIBRARY_PATH          : /Library/Frameworks/R.framework/Resources/lib:/Users/statwonk/lib:/usr/local/lib:/usr/lib:::/lib:/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/jre/lib/server
EDITOR                              : vi
EVENTS_W_PROPERTIES                 : *** redacted ***
GIT_ASKPASS                         : rpostback-askpass
HOME                                : /Users/statwonk
ITERM_PROFILE                       : Default
ITERM_SESSION_ID                    : *** redacted ***
LANG                                : en_US.UTF-8
LC_CTYPE                            : en_US.UTF-8
LC_TERMINAL                         : iTerm2
LC_TERMINAL_VERSION                 : 3.3.1
LESS                                : -R
LN_S                                : ln -s
LOGNAME                             : *** redacted ***
LSCOLORS                            : *** redacted ***
MAKE                                : make
NPM_TOKEN                           : *** redacted ***
NVM_BIN                             : /Users/statwonk/.nvm/versions/node/v10.14.2/bin
NVM_CD_FLAGS                        : -q
NVM_DIR                             : /Users/statwonk/.nvm
OBJC_DISABLE_INITIALIZE_FORK_SAFETY : YES
OLDPWD                              : /Users/statwonk
PAGER                               : less
PATH                                : /Users/statwonk/.nvm/versions/node/v10.14.2/bin:/Users/statwonk/.local/bin:/Users/statwonk/.poetry/bin:/Users/statwonk/.pyenv/shims:/usr/local/Cellar/pyenv-virtualenv/1.1.3/shims:/Users/statwonk/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/RStudio.app/Contents/MacOS/postback
PWD                                 : /Users/statwonk/backup-rstudio-desktop
PYENV_SHELL                         : zsh
PYENV_VIRTUAL_ENV                   : *** redacted ***
PYENV_VIRTUALENV_DISABLE_PROMPT     : 1
PYENV_VIRTUALENV_INIT               : 1
R_BROWSER                           : /usr/bin/open
R_BZIPCMD                           : /usr/bin/bzip2
R_DOC_DIR                           : /Library/Frameworks/R.framework/Resources/doc
R_GZIPCMD                           : /usr/bin/gzip
R_HOME                              : /Library/Frameworks/R.framework/Resources
R_INCLUDE_DIR                       : /Library/Frameworks/R.framework/Resources/include
R_LIBS_SITE                         : 
R_LIBS_USER                         : ~/Library/R/4.0/library
R_PAPERSIZE                         : a4
R_PDFVIEWER                         : /usr/bin/open
R_PLATFORM                          : x86_64-apple-darwin17.0
R_PRINTCMD                          : lpr
R_QPDF                              : /Library/Frameworks/R.framework/Resources/bin/qpdf
R_RD4PDF                            : times,inconsolata,hyper
R_SESSION_TMPDIR                    : /var/folders/kp/dtgbv7z15pj_3ff9jvv3bwyr0000gn/T//RtmpXuhPiM
R_SHARE_DIR                         : /Library/Frameworks/R.framework/Resources/share
R_STRIP_SHARED_LIB                  : strip -x
R_STRIP_STATIC_LIB                  : strip -S
R_SYSTEM_ABI                        : macos,gcc,gxx,gfortran,gfortran
R_TEXI2DVICMD                       : /usr/local/bin/texi2dvi
R_UNZIPCMD                          : /usr/bin/unzip
R_ZIPCMD                            : /usr/bin/zip
RMARKDOWN_MATHJAX_PATH              : /Applications/RStudio.app/Contents/Resources/resources/mathjax-27
RS_PPM_FD_READ                      : 3
RS_PPM_FD_WRITE                     : 12
RS_RPOSTBACK_PATH                   : /Applications/RStudio.app/Contents/MacOS/rpostback
RS_SHARED_SECRET                    : *** redacted ***
RSTUDIO                             : 1
RSTUDIO_CONSOLE_COLOR               : 256
RSTUDIO_CONSOLE_WIDTH               : 80
RSTUDIO_PANDOC                      : /Applications/RStudio.app/Contents/MacOS/pandoc
RSTUDIO_PROGRAM_MODE                : desktop
RSTUDIO_SESSION_PORT                : 32092
RSTUDIO_USER_IDENTITY               : statwonk
RSTUDIO_WINUTILS                    : bin/winutils
SED                                 : /usr/bin/sed
SHELL                               : /bin/zsh
SHLVL                               : 1
SSH_ASKPASS                         : rpostback-askpass
SSH_AUTH_SOCK                       : *** redacted ***
TAR                                 : /usr/bin/tar
TERM                                : xterm-256color
TERM_PROGRAM                        : iTerm.app
TERM_PROGRAM_VERSION                : 3.3.1
TERM_SESSION_ID                     : *** redacted ***
TMPDIR                              : /var/folders/kp/dtgbv7z15pj_3ff9jvv3bwyr0000gn/T/
USER                                : statwonk
VIRTUAL_ENV                         : *** redacted ***
XPC_FLAGS                           : 0x0
XPC_SERVICE_NAME                    : 0
ZSH                                 : /Users/statwonk/.oh-my-zsh


R Version
--------------------------------------------------
platform       : x86_64-apple-darwin17.0
arch           : x86_64
os             : darwin17.0
system         : x86_64, darwin17.0
status         : 
major          : 4
minor          : 0.3
year           : 2020
month          : 10
day            : 10
svn rev        : 79318
language       : R
version.string : R version 4.0.3 (2020-10-10)
nickname       : Bunny-Wunnies Freak Out


R Home
--------------------------------------------------
/Library/Frameworks/R.framework/Resources


R Search Path
--------------------------------------------------
.GlobalEnv       
tools:rstudio    
package:stats    
package:graphics 
package:grDevices
package:utils    
package:datasets 
package:methods  
Autoloads        
package:base     


R Library Paths
--------------------------------------------------
/Library/Frameworks/R.framework/Versions/4.0/Resources/library


Loaded Packages
--------------------------------------------------
base      : /Library/Frameworks/R.framework/Resources/library/base                  
compiler  : /Library/Frameworks/R.framework/Versions/4.0/Resources/library/compiler 
datasets  : /Library/Frameworks/R.framework/Versions/4.0/Resources/library/datasets 
graphics  : /Library/Frameworks/R.framework/Versions/4.0/Resources/library/graphics 
grDevices : /Library/Frameworks/R.framework/Versions/4.0/Resources/library/grDevices
methods   : /Library/Frameworks/R.framework/Versions/4.0/Resources/library/methods  
stats     : /Library/Frameworks/R.framework/Versions/4.0/Resources/library/stats    
tools     : /Library/Frameworks/R.framework/Versions/4.0/Resources/library/tools    
utils     : /Library/Frameworks/R.framework/Versions/4.0/Resources/library/utils    


Installed Packages
--------------------------------------------------
        Package                                                        LibPath  Version
1       askpass /Library/Frameworks/R.framework/Versions/4.0/Resources/library      1.1
2    assertthat /Library/Frameworks/R.framework/Versions/4.0/Resources/library    0.2.1
3          base /Library/Frameworks/R.framework/Versions/4.0/Resources/library    4.0.3
4     base64enc /Library/Frameworks/R.framework/Versions/4.0/Resources/library    0.1-3
5            BH /Library/Frameworks/R.framework/Versions/4.0/Resources/library 1.72.0-3
6          boot /Library/Frameworks/R.framework/Versions/4.0/Resources/library   1.3-25
7          brew /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.0-6
8          brio /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.1.0
9         callr /Library/Frameworks/R.framework/Versions/4.0/Resources/library    3.5.1
10        class /Library/Frameworks/R.framework/Versions/4.0/Resources/library   7.3-17
11          cli /Library/Frameworks/R.framework/Versions/4.0/Resources/library    2.2.0
12        clipr /Library/Frameworks/R.framework/Versions/4.0/Resources/library    0.7.1
13      cluster /Library/Frameworks/R.framework/Versions/4.0/Resources/library    2.1.0
14    codetools /Library/Frameworks/R.framework/Versions/4.0/Resources/library   0.2-16
15   commonmark /Library/Frameworks/R.framework/Versions/4.0/Resources/library      1.7
16     compiler /Library/Frameworks/R.framework/Versions/4.0/Resources/library    4.0.3
17         covr /Library/Frameworks/R.framework/Versions/4.0/Resources/library    3.5.1
18       crayon /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.3.4
19  credentials /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.3.0
20    crosstalk /Library/Frameworks/R.framework/Versions/4.0/Resources/library  1.1.0.1
21         curl /Library/Frameworks/R.framework/Versions/4.0/Resources/library      4.3
22     datasets /Library/Frameworks/R.framework/Versions/4.0/Resources/library    4.0.3
23         desc /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.2.0
24     devtools /Library/Frameworks/R.framework/Versions/4.0/Resources/library    2.3.2
25      diffobj /Library/Frameworks/R.framework/Versions/4.0/Resources/library    0.3.2
26       digest /Library/Frameworks/R.framework/Versions/4.0/Resources/library   0.6.27
27           DT /Library/Frameworks/R.framework/Versions/4.0/Resources/library     0.16
28     ellipsis /Library/Frameworks/R.framework/Versions/4.0/Resources/library    0.3.1
29     evaluate /Library/Frameworks/R.framework/Versions/4.0/Resources/library     0.14
30        fansi /Library/Frameworks/R.framework/Versions/4.0/Resources/library    0.4.1
31      foreign /Library/Frameworks/R.framework/Versions/4.0/Resources/library   0.8-80
32           fs /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.5.0
33         gert /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.0.2
34           gh /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.2.0
35     gitcreds /Library/Frameworks/R.framework/Versions/4.0/Resources/library    0.1.1
36         glue /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.4.2
37     graphics /Library/Frameworks/R.framework/Versions/4.0/Resources/library    4.0.3
38    grDevices /Library/Frameworks/R.framework/Versions/4.0/Resources/library    4.0.3
39         grid /Library/Frameworks/R.framework/Versions/4.0/Resources/library    4.0.3
40        highr /Library/Frameworks/R.framework/Versions/4.0/Resources/library      0.8
41    htmltools /Library/Frameworks/R.framework/Versions/4.0/Resources/library    0.5.0
42  htmlwidgets /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.5.3
43         httr /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.4.2
44          ini /Library/Frameworks/R.framework/Versions/4.0/Resources/library    0.3.1
45     jsonlite /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.7.2
46   KernSmooth /Library/Frameworks/R.framework/Versions/4.0/Resources/library  2.23-17
47        knitr /Library/Frameworks/R.framework/Versions/4.0/Resources/library     1.30
48        later /Library/Frameworks/R.framework/Versions/4.0/Resources/library  1.1.0.1
49      lattice /Library/Frameworks/R.framework/Versions/4.0/Resources/library  0.20-41
50     lazyeval /Library/Frameworks/R.framework/Versions/4.0/Resources/library    0.2.2
51    lifecycle /Library/Frameworks/R.framework/Versions/4.0/Resources/library    0.2.0
52     magrittr /Library/Frameworks/R.framework/Versions/4.0/Resources/library    2.0.1
53     markdown /Library/Frameworks/R.framework/Versions/4.0/Resources/library      1.1
54         MASS /Library/Frameworks/R.framework/Versions/4.0/Resources/library   7.3-53
55       Matrix /Library/Frameworks/R.framework/Versions/4.0/Resources/library   1.2-18
56      memoise /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.1.0
57      methods /Library/Frameworks/R.framework/Versions/4.0/Resources/library    4.0.3
58         mgcv /Library/Frameworks/R.framework/Versions/4.0/Resources/library   1.8-33
59         mime /Library/Frameworks/R.framework/Versions/4.0/Resources/library      0.9
60         nlme /Library/Frameworks/R.framework/Versions/4.0/Resources/library  3.1-149
61         nnet /Library/Frameworks/R.framework/Versions/4.0/Resources/library   7.3-14
62      openssl /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.4.3
63     parallel /Library/Frameworks/R.framework/Versions/4.0/Resources/library    4.0.3
64       pillar /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.4.7
65     pkgbuild /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.2.0
66    pkgconfig /Library/Frameworks/R.framework/Versions/4.0/Resources/library    2.0.3
67      pkgload /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.1.0
68       praise /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.0.0
69  prettyunits /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.1.1
70     processx /Library/Frameworks/R.framework/Versions/4.0/Resources/library    3.4.5
71     promises /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.1.1
72           ps /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.5.0
73        purrr /Library/Frameworks/R.framework/Versions/4.0/Resources/library    0.3.4
74           R6 /Library/Frameworks/R.framework/Versions/4.0/Resources/library    2.5.0
75     rappdirs /Library/Frameworks/R.framework/Versions/4.0/Resources/library    0.3.1
76    rcmdcheck /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.3.3
77         Rcpp /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.0.5
78     rematch2 /Library/Frameworks/R.framework/Versions/4.0/Resources/library    2.1.2
79      remotes /Library/Frameworks/R.framework/Versions/4.0/Resources/library    2.2.0
80          rex /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.2.0
81        rlang /Library/Frameworks/R.framework/Versions/4.0/Resources/library   0.4.10
82     roxygen2 /Library/Frameworks/R.framework/Versions/4.0/Resources/library    7.1.1
83        rpart /Library/Frameworks/R.framework/Versions/4.0/Resources/library   4.1-15
84    rprojroot /Library/Frameworks/R.framework/Versions/4.0/Resources/library    2.0.2
85   rstudioapi /Library/Frameworks/R.framework/Versions/4.0/Resources/library     0.13
86    rversions /Library/Frameworks/R.framework/Versions/4.0/Resources/library    2.0.2
87  sessioninfo /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.1.1
88      spatial /Library/Frameworks/R.framework/Versions/4.0/Resources/library   7.3-12
89      splines /Library/Frameworks/R.framework/Versions/4.0/Resources/library    4.0.3
90        stats /Library/Frameworks/R.framework/Versions/4.0/Resources/library    4.0.3
91       stats4 /Library/Frameworks/R.framework/Versions/4.0/Resources/library    4.0.3
92      stringi /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.5.3
93      stringr /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.4.0
94     survival /Library/Frameworks/R.framework/Versions/4.0/Resources/library    3.2-7
95          sys /Library/Frameworks/R.framework/Versions/4.0/Resources/library      3.4
96        tcltk /Library/Frameworks/R.framework/Versions/4.0/Resources/library    4.0.3
97     testthat /Library/Frameworks/R.framework/Versions/4.0/Resources/library    3.0.1
98       tibble /Library/Frameworks/R.framework/Versions/4.0/Resources/library    3.0.4
99        tools /Library/Frameworks/R.framework/Versions/4.0/Resources/library    4.0.3
100     usethis /Library/Frameworks/R.framework/Versions/4.0/Resources/library    2.0.0
101        utf8 /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.1.4
102       utils /Library/Frameworks/R.framework/Versions/4.0/Resources/library    4.0.3
103       vctrs /Library/Frameworks/R.framework/Versions/4.0/Resources/library    0.3.6
104       waldo /Library/Frameworks/R.framework/Versions/4.0/Resources/library    0.2.3
105     whisker /Library/Frameworks/R.framework/Versions/4.0/Resources/library      0.4
106       withr /Library/Frameworks/R.framework/Versions/4.0/Resources/library    2.3.0
107        xfun /Library/Frameworks/R.framework/Versions/4.0/Resources/library     0.19
108        xml2 /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.3.2
109       xopen /Library/Frameworks/R.framework/Versions/4.0/Resources/library    1.0.0
110        yaml /Library/Frameworks/R.framework/Versions/4.0/Resources/library    2.2.1
111         zip /Library/Frameworks/R.framework/Versions/4.0/Resources/library    2.1.1


R System Profile: /Library/Frameworks/R.framework/Resources/library/base/R/Rprofile
--------------------------------------------------
### This is the system Rprofile file. It is always run on startup.
### Additional commands can be placed in site or user Rprofile files
### (see ?Rprofile).

### Copyright (C) 1995-2020 The R Core Team

### Notice that it is a bad idea to use this file as a template for
### personal startup files, since things will be executed twice and in
### the wrong environment (user profiles are run in .GlobalEnv).

.GlobalEnv <- globalenv()
attach(NULL, name = "Autoloads")
.AutoloadEnv <- as.environment(2)
assign(".Autoloaded", NULL, envir = .AutoloadEnv)
T <- TRUE
F <- FALSE
R.version <- structure(R.Version(), class = "simple.list")
version <- R.version            # for S compatibility

## for backwards compatibility only
R.version.string <- R.version$version.string

## NOTA BENE: options() for non-base package functionality are in places like
##            --------- ../utils/R/zzz.R

options(keep.source = interactive())
options(warn = 0)
# options(repos = c(CRAN="@CRAN@"))
# options(BIOC = "http://www.bioconductor.org")

## setting from an env variable added in 4.0.2
local({to <- as.integer(Sys.getenv("R_DEFAULT_INTERNET_TIMEOUT", 60))
    if (is.na(to) || to <= 0) to <- 60L
    options(timeout = to)
})
options(encoding = "native.enc")
options(show.error.messages = TRUE)
## keep in sync with PrintDefaults() in  ../../main/print.c :
options(scipen = 0)
options(max.print = 99999)# max. #{entries} in internal printMatrix()
options(add.smooth = TRUE)# currently only used in 'plot.lm'

if(isFALSE(as.logical(Sys.getenv("_R_OPTIONS_STRINGS_AS_FACTORS_",
                                 "FALSE")))) {
    options(stringsAsFactors = FALSE)
} else {
    options(stringsAsFactors = TRUE)
}

if(!interactive() && is.null(getOption("showErrorCalls")))
    options(showErrorCalls = TRUE)

local({dp <- Sys.getenv("R_DEFAULT_PACKAGES")
       if(identical(dp, "")) ## it fact methods is done first
           dp <- c("datasets", "utils", "grDevices", "graphics",
                   "stats", "methods")
       else if(identical(dp, "NULL")) dp <- character(0)
       else dp <- strsplit(dp, ",")[[1]]
       dp <- sub("[[:blank:]]*([[:alnum:]]+)", "\\1", dp) # strip whitespace
       options(defaultPackages = dp)
    })

## Expand R_LIBS_* environment variables.
Sys.setenv(R_LIBS_SITE =
           .expand_R_libs_env_var(Sys.getenv("R_LIBS_SITE")))
Sys.setenv(R_LIBS_USER =
           .expand_R_libs_env_var(Sys.getenv("R_LIBS_USER")))

local({
    if(nzchar(tl <- Sys.getenv("R_SESSION_TIME_LIMIT_CPU")))
        setSessionTimeLimit(cpu = tl)
    if(nzchar(tl <- Sys.getenv("R_SESSION_TIME_LIMIT_ELAPSED")))
        setSessionTimeLimit(elapsed = tl)
})

.First.sys <- function()
{
    for(pkg in getOption("defaultPackages")) {
        res <- require(pkg, quietly = TRUE, warn.conflicts = FALSE,
                       character.only = TRUE)
        if(!res)
            warning(gettextf('package %s in options("defaultPackages") was not found', sQuote(pkg)),
                    call. = FALSE, domain = NA)
    }
}

## called at C level in the startup process prior to .First.sys
.OptRequireMethods <- function()
{
    pkg <- "methods" # done this way to avoid R CMD check warning
    if(pkg %in% getOption("defaultPackages"))
        if(!require(pkg, quietly = TRUE, warn.conflicts = FALSE,
                    character.only = TRUE))
            warning('package "methods" in options("defaultPackages") was not found',
                    call. = FALSE)
}

if(nzchar(Sys.getenv("R_BATCH"))) {
    .Last.sys <- function()
    {
        cat("> proc.time()\n")
        print(proc.time())
    }
    ## avoid passing on to spawned R processes
    ## A system has been reported without Sys.unsetenv, so try this
    try(Sys.setenv(R_BATCH=""))
}

local({
    if(nzchar(rv <- Sys.getenv("_R_RNG_VERSION_")))
        suppressWarnings(RNGversion(rv))
})
###-*- R -*- Unix Specific ----

.Library <- file.path(R.home(), "library")
.Library.site <- Sys.getenv("R_LIBS_SITE")
.Library.site <- if(!nchar(.Library.site)) file.path(R.home(), "site-library") else unlist(strsplit(.Library.site, ":"))
.Library.site <- .Library.site[file.exists(.Library.site)]

invisible(.libPaths(c(unlist(strsplit(Sys.getenv("R_LIBS"), ":")),
                      unlist(strsplit(Sys.getenv("R_LIBS_USER"), ":")
                      ))))
local({
    popath <- Sys.getenv("R_TRANSLATIONS", "")
    if(!nzchar(popath)) {
        paths <- file.path(.libPaths(), "translations", "DESCRIPTION")
        popath <- dirname(paths[file.exists(paths)][1])
    }
    bindtextdomain("R", popath)
    bindtextdomain("R-base", popath)
    assign(".popath", popath, .BaseNamespaceEnv)
})
local({
## we distinguish between R_PAPERSIZE as set by the user and by configure
papersize <- Sys.getenv("R_PAPERSIZE_USER")
if(!nchar(papersize)) {
    lcpaper <- Sys.getlocale("LC_PAPER") # might be null: OK as nchar is 0
    papersize <- if(nchar(lcpaper))
        if(length(grep("(_US|_CA)", lcpaper))) "letter" else "a4"
    else Sys.getenv("R_PAPERSIZE")
}
options(papersize = papersize,
        printcmd = Sys.getenv("R_PRINTCMD"),
        dvipscmd = Sys.getenv("DVIPS", "dvips"),
        texi2dvi = Sys.getenv("R_TEXI2DVICMD"),
        browser = Sys.getenv("R_BROWSER"),
        pager = file.path(R.home(), "bin", "pager"),
        pdfviewer = Sys.getenv("R_PDFVIEWER"),
        useFancyQuotes = TRUE)
})

## non standard settings for the R.app GUI of the macOS port
if(.Platform$GUI == "AQUA") {
    ## this is set to let RAqua use both X11 device and X11/TclTk
    if (Sys.getenv("DISPLAY") == "")
	Sys.setenv("DISPLAY" = ":0")

    ## this is to allow gfortran compiler to work
    Sys.setenv("PATH" = paste(Sys.getenv("PATH"),":/usr/local/bin",sep = ""))
}## end "Aqua"

## de-dupe the environment on macOS (bug in Yosemite which affects things like PATH)
if (grepl("^darwin", R.version$os)) local({
    ## we have to de-dupe one at a time and re-check since the bug affects how
    ## environment modifications propagate
    while(length(dupes <- names(Sys.getenv())[table(names(Sys.getenv())) > 1])) {
        env <- dupes[1]
        value <- Sys.getenv(env)
        Sys.unsetenv(env)             ## removes the dupes, good
        .Internal(Sys.setenv(env, value)) ## wrapper requries named vector, a pain, hence internal
    }
})

local({
    tests_startup <- Sys.getenv("R_TESTS")
    if(nzchar(tests_startup)) source(tests_startup)
})


R Site Profile: /Library/Frameworks/R.framework/Resources/etc/Rprofile.site
--------------------------------------------------
(File does not exist)


R User Profile: /Users/statwonk/.Rprofile
--------------------------------------------------
# reticulate::use_python('/Users/statwonk/.pyenv/versions/3.6.6/bin/python', TRUE)


R Site Environ: /Library/Frameworks/R.framework/Resources/etc/Renviron.site
--------------------------------------------------
(File does not exist)


R User Environ: /Users/statwonk/.Renviron
--------------------------------------------------
*** redacted ***= *** redacted ***
*** redacted ***=*** redacted ***


R Temporary Directory
--------------------------------------------------
/var/folders/kp/dtgbv7z15pj_3ff9jvv3bwyr0000gn/T//RtmpXuhPiM


Files in R Temporary Directory
--------------------------------------------------
rs-graphics-01c04575-5438-41db-a8bf-ee01d86a0ddf


Log file: /Users/statwonk/.rstudio-desktop/log/rdesktop.log
--------------------------------------------------

11 Jan 2021 14:23:09 [rdesktop] ERROR Main window closed unexpectedly; LOGGED FROM: auto rstudio::desktop::MainWindow::closeEvent(QCloseEvent *)::(anonymous class)::operator()(QVariant) const src/cpp/desktop/DesktopMainWindow.cpp:499
11 Jan 2021 14:26:16 [rdesktop] ERROR Main window closed unexpectedly; LOGGED FROM: auto rstudio::desktop::MainWindow::closeEvent(QCloseEvent *)::(anonymous class)::operator()(QVariant) const src/cpp/desktop/DesktopMainWindow.cpp:499


Log file: /Users/statwonk/.rstudio-desktop/log/rsession-statwonk.log
--------------------------------------------------

(Not Found)

User prefs: /Users/statwonk/.config/rstudio/rstudio-prefs.json
--------------------------------------------------

{
    "panes": {
        "quadrants": [
            "Source",
            "Console",
            "TabSet1",
            "TabSet2"
        ],
        "tabSet1": [
            "Environment",
            "History",
            "Connections",
            "Build",
            "VCS",
            "Presentation"
        ],
        "tabSet2": [
            "Files",
            "Plots",
            "Packages",
            "Help",
            "Viewer"
        ],
        "console_left_on_top": false,
        "console_right_on_top": true
    },
    "num_spaces_for_tab": 1,
    "show_margin": false,
    "editor_keybindings": "vim",
    "strip_trailing_whitespace": true,
    "editor_theme": "Material",
    "default_project_location": "~",
    "source_with_echo": true,
    "pdf_previewer": "rstudio",
    "restore_source_documents": false,
    "wrap_tab_navigation": false,
    "save_workspace": "never",
    "always_save_history": false,
    "reuse_sessions_for_project_links": true
}

System prefs: /etc/rstudio/rstudio-prefs.json
--------------------------------------------------

(Not Found)

User state: /Users/statwonk/.local/share/rstudio/rstudio-desktop.json
--------------------------------------------------

{
    "context_id": "CDFB4AA7",
    "error_handler_type": "traceback",
    "theme": {
        "name": "Material",
        "url": "theme/default/material.rstheme",
        "isDark": true
    }
}

From RStudio Desktop Will Not Start on support.rstudio.com

This may be related to this issue, which has been fixed in the release version of 1.4 (being announced today!!!)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.