rstudio-prefs.json in a custom location

I cannot seem to get RStudio to honour rstudio-prefs.json in a custom location (on Windows). If I set the XDG_CONFIG_HOME to a custom place, I find my dictionaries and keybindings will be saved there, but the rstudio-prefs.json is not honoured. Any ideas how to get this working?

We are moving to a citrix environment, where out AppData is wiped regularly. We lose all our settings. It's super painful.

Please halp!

1 Like

How exactly are you setting XDG_CONFIG_HOME? The preferences are read very early at startup (before R itself starts) so you need to set the environment variable prior to the launch of RStudio itself.

Hey Jonathan,

Thanks for replying.

I'm setting it with an .Renviron file. Does this explain the issue? Can you set it earlier?


Yes, that's the problem. .Renviron is read by R when it starts up, but at that point RStudio is already running.

You can either set XDG_CONFIG_HOME as a user or system environment variable:

Or, if you only want it set for RStudio, make a shortcut that sets the variable and then starts RStudio:

Eggcellent.. Will try to action this later today. Hopefully can get admins to set this to be persistent in our annoying citrix environment. Thanks again for help!

Works as expected.. Thanks again!

1 Like

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.