You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Using browser() in new file causes double tab of the same file #12702
RStudio Edition : Desktop
RStudio Version : 2022.12.0+353
OS Version : Windows 10, Version 20H2
R Version : R version 4.2.2 (2022-10-31 ucrt)
Steps to reproduce the problem
Create new file
Write browser() in it.
Save file
Run it;
Now, there are two tabs open with the same file.
Describe the problem in detail
This causes you to have two tabs open, one in the initial state, and one further. If you
accidentally save in one of the tabs, it overwrites the file on disk. Absolutely no warning is given
Describe the behavior you expected
I don't expect this to happen:
This has caused me to lose several hours of work, twice in one day.
@CGMossa Thank you for raising the issue! I'm unable to reproduce it, though. How are you running the script in step 4—sourcing the file, running the individual command, etc.?
Ah thanks for that clarification! We have not been able to reproduce this internally yet, so I assumed it was related to symlink files. If you are able to open the same file in two separate windows and edit them separately, I see that as a fairly urgent problem to solve because it can lead to data loss as you experienced.
Would you be willing to try the latest daily (https://dailies.rstudio.com/) to see if this happens with the latest release on your environment? Trying to narrow down the circumstances in which this can occur, since we haven't seen it internally yet despite several people trying. We'd really like to solve this.
It had led to data loss twice in one Sunday. I was about to cry the second
time.
I replicated on my work machine.
I'll answer whatever I can as this issue really.. Yeah.
I installed with scoop using scoop bucket add extras
and scoop install
which installed RStudio Desktop 2022.12.0+353. I'm not able to reproduce the issue. If I source the file, the debugger lands on the browser() line in the source file. If I execute the code line by line, a new tab opens up which only contains the function definition, not a duplicate file.
Remember. It only happens the first time a fresh new file is made.
Make new file. Save it. Browser call. Bang new tab.
Close old tab. Keep going. Everything works then.
You have to create a new file.
Activity
ronblum commentedon Feb 16, 2023
@CGMossa Thank you for raising the issue! I'm unable to reproduce it, though. How are you running the script in step 4—sourcing the file, running the individual command, etc.?
Here's what I get on Windows:

CGMossa commentedon Feb 17, 2023
I think I'm sourcing the file.
This issue happens on both of my machines.
I install rstudio through scoop.
mikebessuille commentedon Feb 21, 2023
@CGMossa does this happen if you are not using symlink files?
CGMossa commentedon Feb 21, 2023
I don't know what you mean by symlink file.
I'm not sure I'm doing that. The issue I was referencing was doing that, but I'm not.
mikebessuille commentedon Feb 21, 2023
Ah thanks for that clarification! We have not been able to reproduce this internally yet, so I assumed it was related to symlink files. If you are able to open the same file in two separate windows and edit them separately, I see that as a fairly urgent problem to solve because it can lead to data loss as you experienced.
Would you be willing to try the latest daily (https://dailies.rstudio.com/) to see if this happens with the latest release on your environment? Trying to narrow down the circumstances in which this can occur, since we haven't seen it internally yet despite several people trying. We'd really like to solve this.
CGMossa commentedon Feb 21, 2023
CGMossa commentedon Feb 21, 2023
I can report that using daily build
‘2023.3.0.330’, the issue is still present.mikebessuille commentedon Feb 21, 2023
Thanks! @ronblum I think someone should see if installing using scoop is somehow related to this.
ronblum commentedon Feb 21, 2023
I installed with scoop using
scoop bucket add extrasand
scoop installwhich installed RStudio Desktop 2022.12.0+353. I'm not able to reproduce the issue. If I source the file, the debugger lands on the
browser()line in the source file. If I execute the code line by line, a new tab opens up which only contains the function definition, not a duplicate file.CGMossa commentedon Feb 21, 2023
Remember. It only happens the first time a fresh new file is made.
Make new file. Save it. Browser call. Bang new tab.
Close old tab. Keep going. Everything works then.
You have to create a new file.