Can I get RStudio to show the project name rather than the folder location on the window name?


#1

To illustrate what I’m talking about, this is what I see on my taskbar when I have my RStudio projects open. The full title of the window says “C:/Users/John/Dropbox/nba_fantasy - RStudio”. Now, correct me if I’m much mistaken but didn’t it use to give the project name rather than the folder location? Have I unticked something somewhere to change it?

2017-12-03_16-40-26


#2

I see the same behavior with RStudio v0.99 as well. Unless something has changed in the latest version(s) of Windows, as far as I know this is the expected / default behavior and cannot be configured.


#3

Yeah, I googled around a bit and it seems it’s always been that way. In that case, feature request: have the window title show the project name rather than the folder location.


#4

I agree this would be a welcome change. Would you mind filing this as a feature request at https://github.com/rstudio/rstudio/issues?


#5

Here you go: https://github.com/rstudio/rstudio/issues/1817


#6

Turns out I was remembering something right. Below are two different projects open. The first one is is showing the full directory, the second is located in C:/Users/John/Documents and displaying the project name, more or less, like I’d want to. Apparently Documents is the home folder for something.

2017-12-15_05-58-26


#7

RStudio shows paths relative to what R considers the ‘home’ directory. On Windows, this can be specified by either the HOME or the R_USER environment variables. When these variables are unset (which they typically are), R asks the operating system what the ‘personal’ directory for a user is:

Which (from the Windows documentation) suggests that this is the Documents folder within the user’s %USERPROFILE% directory:

https://msdn.microsoft.com/en-us/library/windows/desktop/bb762494(v=vs.85).aspx

So we’re still actually showing a ‘full’ path – we’ve just hidden the home directory bit inside the tilde.

Note that, after startup, R will populate the R_USER environment variable based on what folder it decided to use as the home directory.