Using RC9. Project has multiple tabs. Out of the blue, IDE is now showing DUPLICATES. For example, the tab titles as well as the code within the tab are repeated. IDE shows tab1, tab2, tab3, then repeats: tab1, tab2, tab3.
If I make a change to the code in a tab I can save it, either immediately or when I compile. The tab content of the other duplicate is not changed. If not careful, I can lose the changes I just made if I go to the wrong tab.
I never experienced this with previous beta rc versions; nor did it happen using any version 1.x of the IDE.
Hi @davycastle . Thanks for your report.
There have been multiple reports of this issue:
opened 05:07PM - 03 Dec 21 UTC
closed 12:59AM - 19 Jul 22 UTC
topic: code
type: imperfection
I use multiple files in the project and unfortunately after upgrading from beta … 11 to RC1 I have a problem with the open file names in the project. In addition to the name, the path is also displayed, so the whole tab is nonsense.
**Screenshots**

**Desktop (please complete the following information):**
- OS: Windows 10 64bit
- Version: RC1
opened 04:40PM - 01 Feb 22 UTC
closed 09:33AM - 31 May 22 UTC
conclusion: resolved
topic: code
type: imperfection
criticality: high
## Describe the bug
The <kbd>▼</kbd> button on the right side of the editor b… ar lists all the editor tabs of the sketch. The user can select the tab from this menu, which can be useful for navigating sketches with many tabs.
:bug: If a sketch tab which has not previously been opened via the standard tab UI is opened from this menu, a duplicate tab is opened.
## To Reproduce
1. Select **File > New** from the Arduino IDE menus.
1. Click the <kbd>▼</kbd> button on the right side of the editor bar.
1. Select "**New Tab**" from the tab control menu.
1. In the "**Name for new file**" field, type `TabB`.
1. Click the <kbd>OK</kbd> button.
1. Save the sketch as "**TabA**".
1. Close the IDE window that has "**TabA**" open.
(this is necessary because the bug only occurs when a tab has not yet been opened in the current window, and at this point both the tabs have been opened)
1. Open the "**TabA**" sketch in the Arduino IDE.
1. Click the <kbd>▼</kbd> button on the right side of the editor bar.
1. From the menu, select whichever of the two tabs is not currently open in the editor.
:bug: You now have two duplicate tabs for the file that was selected from the menu:

(in this screenshot, I selected "**TabA.ino**" from the menu)
## Expected behavior
Each sketch file only ever gets a single tab in the editor.
## Desktop
### Original report
- OS: Windows 10
- Version: 2.0.0-rc3-snapshot.759b410
Date: 2022-01-31T13:15:29.574Z
CLI Version: 0.20.2 [13783819]
### Last checked with
- OS: Windows 10
- Version: 2.0.0-rc3-snapshot-2f9bf86
Date: 2022-02-11T14:52:06.341Z
CLI Version: 0.21.0 [10107d24]
## Additional context
This is most likely another incarnation of the same bug that causes https://github.com/arduino/arduino-ide/issues/656. I decided to open a separate issue for it since this one is encountered via a significantly different and more common UI path than https://github.com/arduino/arduino-ide/issues/656 and there have been multiple user reports of this general issue.
The duplicate tabs contain the file parent path as reported at https://github.com/arduino/arduino-ide/issues/665
---
The issue is not dependent on the specific sketch creation method from the instructions. It will occur with any multi-tab sketch.
opened 10:14AM - 11 Jun 22 UTC
topic: code
type: imperfection
### Describe the problem
I opened a project and i noticed that some tabs had th… e file path in it and that some tabs had duplicates
<img width="2756" alt="Capture" src="https://user-images.githubusercontent.com/52797081/173183310-2f05733b-06f5-4c3d-bb0d-0583488520aa.PNG">
I did some searches about it and some people had different cause for it like opening from recent,...
I found the cause in my case : My project is a copy made by the "save as" menu. By saving that way the editor adds "_copy" and the date and time to the saved filename.
By deleting the Date and Time from the .ino file and the folder, my problem disappears.
Maybe the cause is something to do with filename length or "total file path" too long ?
I hope it will help someusers or the Arduino team.
Have a nice day !
### To reproduce
Maybe make a long file name with lots of caracters in it ?
### Expected behavior
Duplicate Tabs and file path in tabs
### Arduino IDE version
2.0.0 RC7
### Operating system
Windows
### Operating system version
Win 10 family 21H2
### Additional context
_No response_
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://github.com/arduino/arduino-ide#nightly-builds)
- [X] My report contains all necessary details
opened 07:21AM - 13 Jun 22 UTC
closed 08:11AM - 22 Jun 22 UTC
conclusion: resolved
topic: code
type: imperfection
criticality: high
### Describe the problem
The Arduino IDE's language server-based "Go to defin… ition" feature reveals the definition of a code component. If that definition is in a file that is not already open in an editor tab, a tab must be added for that file. If the file is already open in a tab then that tab is simply selected and the cursor placed at the start of the definition.
🐛 If the sketch was created in an earlier version of the Arduino IDE, "Go to definition" for a definition within one of the open sketch editor tabs causes the creation of a confusing duplicate tab instead of simply using the existing tab.
### To reproduce
1. Start Arduino IDE 2.0.0-rc6.
1. Select **File > New** from the Arduino IDE menus.
1. Create a sketch that contains a function definition and a call to that function:
```cpp
void setup() {
foo();
}
void loop() {}
void foo() {}
```
1. Save the sketch to any convenient name and location.
1. Select **File > Quit** from the Arduino IDE menus.
1. Start the latest version of the Arduino IDE.
1. Open the sketch you created if it is not already.
1. Select any board with language server support (e.g., Arduino Uno) from the **Tools > Board** menu in the Arduino IDE.
1. Select the editor.
1. Right click on the function call:
```cpp
foo();
```
1. Select "**Go to Definition**" from the context menu.
🐛 A duplicate tab is created.
🐛 The cursor is only moved to the start of the function definition in the newly created tab, and that tab is not selected, so the user is not guided to the function definition in any meaningful way.

### Expected behavior
Duplicate tabs are not created.
### Arduino IDE version
2.0.0-rc7
### Operating system
Windows
### Operating system version
Windows 10
### Additional context
Related:
- https://github.com/arduino/arduino-ide/issues/1044
- https://github.com/arduino/arduino-ide/pull/1024
- https://github.com/arduino/arduino-ide/issues/656
- https://github.com/arduino/arduino-ide/issues/793
---
Originally reported at https://forum.arduino.cc/t/ctrl-click-navigation/1000117/19
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://github.com/arduino/arduino-ide#nightly-builds)
- [X] My report contains all necessary details
The developers made fixes for them:
arduino:main
← arduino:msujew/fix-duplicate-tabs
opened 02:26PM - 30 May 22 UTC
### Motivation
Closes https://github.com/arduino/arduino-ide/issues/656
Clos… es https://github.com/arduino/arduino-ide/issues/793
### Change description
Since editor widget identity is based not only on the `URI`, but also the options, we need to pass the correct options into the `open` call. Doing that prevents Theia from opening multiple tabs of the same editor
### Other information
You might need to run the `View: reset workbench layout` command before testing this, since it modifies some state which is stored (in parts) in the browsers local storage.
### Reviewer checklist
* [ ] PR addresses a single concern.
* [ ] The PR has no duplicates (please search among the [Pull Requests](https://github.com/arduino/arduino-ide/pulls) before creating one)
* [ ] PR title and description are properly filled.
* [ ] Docs have been added / updated (for bug fixes / features)
arduino:main
← arduino:editor-manager-di
opened 12:52PM - 07 Jun 22 UTC
### Motivation
This PR should fix the duplicate editor tab issue.
### Chan… ge description
- Fixes the dependency injection by binding the editor manager in a singleton scope,
- Added a workaround in the layout data parser to drop preview editor constructions options when restoring the layout at app startup.
### Other information
### Reviewer checklist
* [ ] PR addresses a single concern.
* [ ] The PR has no duplicates (please search among the [Pull Requests](https://github.com/arduino/arduino-ide/pulls) before creating one)
* [ ] PR title and description are properly filled.
* [ ] Docs have been added / updated (for bug fixes / features)
arduino:main
← arduino:#1054-deepEquals
opened 02:40PM - 20 Jun 22 UTC
### Motivation
Fixes duplicate editor tabs due to bogus widget identity com… parison in the widget manager.
### Change description
- Removed `@theia/editor-preview`,
- Patched opener options when repairing layout on start, and
- Compare widget keys with `deepEquals` instead of string equal.
### Other information
Closes #1054
### Reviewer checklist
* [ ] PR addresses a single concern.
* [ ] The PR has no duplicates (please search among the [Pull Requests](https://github.com/arduino/arduino-ide/pulls) before creating one)
* [ ] PR title and description are properly filled.
* [ ] Docs have been added / updated (for bug fixes / features)
After those fixes, I have no longer been able to reproduce the issues and we didn't receive any other reports of such issues. However, all those fixes are in the Arduino IDE 2.0.0-rc8 version you are using.
Does this occur even if you open a new sketch via File > New , or does it only occur with specific sketches?
The posts above mention that there was a fix delivered a few months ago, but I'm here to say that I have experienced it myself for the first time today, on a fresh Windows 10 install with an (obviously fresh) Arduino IDE 2.0.3, so the problem is far from being fixed No matter what I do, I get duplicated tabs on "example sketches" or my own, either saved on the disk or newly created sketches on the fly. It really must be fixed, cause changes in one tab do NOT get ported to the other, duplicate tab, so you'll easily lose your changes if you don't always use the same tab.
Make Sure there are NO SPACES in sketch directory and file. I renamed mine and problem solved no duplicate tabs
Hi @otringal . It seems there may have been a regression since the time of that fix. The Arduino IDE developers are tracking the new incarnation of this bug here:
opened 04:46PM - 29 Dec 22 UTC
closed 04:56PM - 28 Mar 23 UTC
conclusion: resolved
topic: code
type: imperfection
### Describe the problem
I included a library via the menu and somehow this r… esulted in another tab opening for the same file. When I try to delete the file nothing happens. I've tried to move the sketch to some other folder and then open and that seems to work (after it renames the parent folder), but when I move it back to the original folder the new tab reappears.
I'm on Ubuntu 22.04.1 LTS and the latest stable version of the IDE shown on the website at the time of writing (2.0.3). I also tested on the latest nightly and it occurs there too.
If you need log files or something, please let me know.

### To reproduce
I tried reproducing and couldn't. But the issue is still there, even when I open the project on the nightly build.
### Expected behavior
Delete closes the tab. Or closing and reopening the ediitor...
### Arduino IDE version
2.04-nightly-20221229
### Operating system
Linux
### Operating system version
22.04.1 LTS
### Additional context
The fact that this occurs across builds and after moving things around makes me think this has something to do with some kind of cache or (sketch?) settings file somewhere, but I don't know for sure.
I also remember the save icon being on briefly. I have autosave on, so I'm not sure if this happened before or after the library was included.
---
Additional reports:
- https://github.com/arduino/arduino-ide/issues/656#issuecomment-1363100279
- https://forum.arduino.cc/t/double-tabs-of-same-sketch/1089318
- https://forum.arduino.cc/t/2-0-beta-rc9-duplicate-tabs/1012459/4
- https://forum.arduino.cc/t/2-0-beta-rc9-duplicate-tabs/1012459/5
- https://forum.arduino.cc/t/arduino-ide-2-0-3-duplicate-tab-page/1084561
- https://forum.arduino.cc/t/ide-restarts-during-a-start/1081761
- Includes screencast and logs
- https://forum.arduino.cc/t/ide-2-0-3-double-tabs/1066585/1
- https://forum.arduino.cc/t/ide-2-0-3-double-tabs/1066585/2
- https://forum.arduino.cc/t/ide-2-0-3-double-tabs/1066585/3
- https://forum.arduino.cc/t/ide-2-0-3-double-tabs/1066585/4
- https://forum.arduino.cc/t/ide-2-0-3-double-tabs/1066585/7
- https://forum.arduino.cc/t/ide-2-0-3-double-tabs/1066585/8
- https://forum.arduino.cc/t/ide-2-0-3-double-tabs/1066585/9
- https://forum.arduino.cc/t/ide-2-0-3-double-tabs/1066585/10
- https://forum.arduino.cc/t/ide-2-0-3-double-tabs/1066585/11
- https://forum.arduino.cc/t/new-year-new-problems/1072182
- https://arduino.stackexchange.com/questions/91777/how-to-get-rid-of-the-second-tab-in-arduino-ide-2
---
Related:
- Previous incarnations of the duplicate tab bug (resolved:
- Issues:
- https://github.com/arduino/arduino-ide/issues/1054
- https://github.com/arduino/arduino-ide/issues/793
- https://github.com/arduino/arduino-ide/issues/665
- https://github.com/arduino/arduino-ide/issues/656
- PRs:
- https://github.com/arduino/arduino-ide/pull/1085
- https://github.com/arduino/arduino-ide/pull/1024
- https://github.com/arduino/arduino-ide/pull/1012
- https://github.com/arduino/arduino-ide/issues/482
- This bug produces a similar fault, but is otherwise unrelated.
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://www.arduino.cc/en/software#nightly-builds)
- [X] My report contains all necessary details
If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject.
Thanks for sharing your observation @FlyingCanuck ! I did some experiments with sketches containing spaces in directory and file names and was not able to reproduce the fault. So unfortunately it seems the bug is not so straightforward as a universal incompatibility with spaces in sketch paths.
An alternative explanation for this result is that Arduino IDE stores data about the UI state associated with a given sketch project separately from the sketch files. That data is keyed to the sketch path. So if the bad duplicate tabs state is stored for the sketch at one path, when you move the sketch, you also disassociate it from that previous data and the IDE instead creates a new data entry for the project at that new location.
If my hypothesis is correct, we would expect the duplicate tabs to go away even if you renamed it to some name that still contained spaces as it is the renaming alone that restores the sketch to the correct state.
system
Closed
August 9, 2023, 4:56am
7
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.