Repository navigation
Description
System details
RStudio Edition : Desktop
RStudio Version : 2024.09.1+394
OS Version : MacOS 14.16.1
R Version : 4.4.2
Steps to reproduce the problem
Replicate bug :
- Start RStudio from dock or Application folder
- Right-click RStudio icon in dock and click "New RStudio window"
The new instance of RStudio starts at working directory/
Replicate expected behavior
- Start RStudio from dock or Application folder
- Session > New session or, alternatively, run
open -n /Applications/RStudio.appin Terminal
The new instance of RStudio starts at the working directory that is set in Global options > General > Default working directory (~ by default).
Describe the problem in detail
When starting a new instance of RStudio by clicking "new window" from the icon in the dock of a currently-running instance, the new instance starts but sets the working directory and current terminal location to / , which is not writable and causes all sorts of issues until a manual setwd() command is issued to move to a more user-friendly directory.
I have replicated this issue with all possible install types of RStudio and R (Homebrew + Homebrew, PKG + DMG, combination of both...). At every fresh install, I also remove all remnants of the previous one (e.g. following this guide for config leftovers)
Describe the behavior you expected
The expected behavior is that the new instance/session will start at the default location set in the options. This happens on my 2023 M3Max MBP. I recently got my hands on a mint 2022 M2Pro MBP and had to set it up while the M3 was being repaired. I did not run into that same issue so I can definitely appreciate this is not entirely easy to replicate and this may very well be an issue related to my setup. Thing is, I have tried pretty much everything that could come into mind and am now at the stage where I don't know what else to attempt. I can't even understand what the difference is between starting the app with open -n in CLI compared to using the "New RStudio window" in the dock menu" (in terms of issued command).
Is there any way to troubleshoot what happens exactly when I click that "Open new window" menu item ?
edit: Note this is not a new issue I've been experiencing that for the pasy year or so and throughout updates. I've just now reached the point where it bothers me too much not to try and understand it.
- I have read the guide for submitting good bug reports.
- I have installed the latest version of RStudio, and confirmed that the issue still persists.
- Even though i'm not reporting a crash 'per-se', I'm attaching a diagnostics-report.txt
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
Activity
gtritchie commentedon Nov 12, 2024
I was able to repro:
Start RStudio, then right-click on Dock icon and choose "New RStudio Window."
The new instance starts up with
/as the current working directory.gtritchie commentedon Nov 14, 2024
Also repro'd with 2023.06.2+561, so this isn't a recent regression; probably been this way since the move to Electron.
tobadia commentedon Nov 14, 2024
Yep, very likely. To be fair I've observed this since my work laptop leasing expired in late 2023 and I got a brand new one to replace it. I moved from an Intel (2019) MBP to a Silicon (2023) one last February and that happened right away. It just didn't bother me enough to investigate thoroughly until now.
gtritchie commentedon Nov 14, 2024
Too late to get into the version we're finalizing now, but I will add it to the next release. This seems fundamentally broken and we should definitely fix it!
gtritchie commentedon Feb 1, 2025
Verified with build 2025.04.0+273.
When no project is open the new window opens with home directory as current working directory, when a project is open the new window opens with the project root as the current working directory.
NOTE: opened #15669 as an offshoot of this. Figured a new issue makes more sense than overloading this one.
Start the Dock's New RStudio Window with no project (#18786)