# \[IDE 2.0.3\]Double tabs

**URL:** <https://forum.arduino.cc/t/ide-2-0-3-double-tabs/1066585>\
**Category:** IDE 2.x\
**Created:** [December 17, 2022, 5:15pm UTC](https://forum.arduino.cc/t/ide-2-0-3-double-tabs/1066585 "2022-12-17T17:15:49Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [January 3, 2023, 5:39am UTC](https://forum.arduino.cc/t/ide-2-0-3-double-tabs/1066585/5 "2023-01-03T05:39:44Z")

</div>

Thanks for your reports everyone.

The Arduino IDE developers are tracking this bug via the formal report here:

> <https://github.com/arduino/arduino-ide/issues/1791>
>
> \### 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.
> 
> !\[image\](https://user-images.githubusercontent.com/31189070/209982612-ecc4ae19-0ac0-40a7-87c3-f10fe0d66655.png)
> 
> 
> \### 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/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/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**](https://github.com/) account, you can subscribe to that issue to get notifications of any new developments related to this subject.

* * *

Unfortunately, I have not been able to reproduce this fault via use patterns resembling those described here and in the associated reports. I am aware of a couple of other use patterns that can produce duplicate tabs, which I have listed [here](https://github.com/arduino/arduino-ide/issues/1791#issuecomment-1369406259), however, I think the fault you are encountering is produced by some other unknown conditions.

I found this workaround removes the duplicate tabs from a sketch when I produce the fault via either of those known procedures:

1. Press the **Ctrl** + **Shift** + **P** keyboard shortcut ( **Command** + **Shift** + **P** for macOS users) to open the " **Command Palette**".
2. Select the " **View: Reset Workbench Layout**" command from the menu.

This is clearing bad "workbench" data associated with a given sketch, which was produced by a change to the environment since that data was originally established. The reports here of the fault occurring even with a new sketch indicate that the data is bad from the very start, so I'm not sure whether the workaround will be effective in that case. If you try it out, please let me know what results you get.

* * *

The fact the Arduino IDE developers and I are not able to reproduce the fault as it affects you makes the preparation and validation of a fix for this bug more difficult. If anyone is able to determine the specific conditions required to produce the fault, that would be very helpful.

One such condition seems to be the use of Arduino IDE 2.0.3 or newer. I surveyed all the reports and found they have this in common. So it seems there was some regression between 2.0.2 and 2.0.3. From experience with the previous incarnations of this type of bug, my suspicion is it was here:

> <https://github.com/arduino/arduino-ide/pull/1662>
>
> \### Motivation
> 
> 
> \### Change description
> 
> 
> \### Other information
> 
> 
> Switc…hed to \`@theia/\*@1.31.1\`:
> - Aligned the \`p-queue\` version to Theia.
> - Updated to \`react@18+\` from Theia. Replaced the \`ReactDOM#render\` calls with \`createRoot\`.
> - Added \`react-virtualized\` as a dependency. It was removed from Theia.
> - Updated to \`react-select@5.6.0\`.
> - Removed custom theme registration patch. Theia supports theme service customization and the default theme despatching on the OS theme.
> - Removed tab bar toolbar customization. ~IDE2 switched to the ellipses (\`...\`) icon from \`font-awesome\` to \`codicon\`.~ (Reverted)
> 
> https://user-images.githubusercontent.com/1405703/201353966-329bc94d-1de5-4582-b6e0-fcaa7cd6d36e.mp4
> - Removed the debug session manager \[customization\](https://github.com/arduino/arduino-ide/commit/f1bffaab2d658afe063797d2b0c09b0240af9ef4#diff-0b4e3216be464eb4dd98e2e90c65bdd93b023735c8125d201881d3be43eff3e4). The customization solved the same problem as \[#994\](https://github.com/arduino/arduino-ide/issues/994). Steps to verify:
> - Auto-save is on,
> - Create a new sketch,
> - Attach and select a debug-enabled board (e.g., Arduino Zero (Programming Port)),
> - Click \`Upload\` on the toolbar,
> - Click on the \`Debug\` toolbar item,
> - Debugger starts and hits the breakpoint if you have any, but IDE2 does \*\*not\*\* prompt \_Save as\_.
> - Removed the \[#856\](https://github.com/arduino/arduino-ide/pull/856) patch when saving the settings. Saving the settings must work with it.
> - Removed the status bar customization. Theia does not update the status bar on every \`keydown\` event and will spare the CPU. Avoid updating the status bar update is crucial for the language server's performance. The change was \[here\](https://github.com/arduino/arduino-ide/commit/b62f3dec84a677af9dad7b66c0516905d62f3803). Steps to verify (\*\*Advanced!\*\*):
> - Open the DevTools and search for \`status-bar-view-model.ts\` with \`Ctrl/Cmd+P\`. Put a breakpoint to \[line 133\](https://github.com/eclipse-theia/theia/blob/v1.31.1/packages/core/src/browser/status-bar/status-bar-view-model.ts#L133).
> - Start typing in the opened sketch editor,
> - The debugger does not hit the breakpoint, and the \`didChange\` event does \*\*not\*\* fire.
> - Press \`Ctrl/Cmd+K\` in the editor. \`monaco\`'s key chords functionality activates. 
> \<img width="314" alt="Screen Shot 2022-11-11 at 14 14 54" src="https://user-images.githubusercontent.com/1405703/201353863-1b1d27eb-184d-4478-a1b3-4ea1785b1f33.png"\>
> - Now, press any key, and the debugger hits the breakpoint. This verifies that any arbitrary key press won't slow IDE's UI as the status bar update is not happening.
> - Removed widget manager customization to avoid duplicate editor tabs. It was fixed upstream: \[eclipse-theia/theia#11450\](https://github.com/eclipse-theia/theia/pull/11450).
> - Switched to Theia's new window title service API. Closes \[#1656\](https://github.com/arduino/arduino-ide/issues/1656).
> - Removed workspace service customization. It's part of Theia via \[eclipse-theia/theia#11571\](https://github.com/eclipse-theia/theia/pull/11571). Step to verify: open another sketch from the \_Sketchbook\_ via the context menu \> \`Open Sketch in New Window\`. If it works, you have helped verify that IDE2 windows can still pass arguments between each other without tricks in the IDE2 code-base.
> - Removed the patch of \[eclipse-theia/theia#11689\](https://github.com/eclipse-theia/theia/pull/11689). IDE2 must pick up keyboard layout changes without stopping/starting.
> - Removed the customization of \[eclipse-theia/theia#11229\](https://github.com/eclipse-theia/theia/pull/11229). It was fixed in Theia.
> - Adapted the menu factory APIs to Theia. Steps to verify: if the visibility and enablement of the \`File\` \> \`New Remote Sketch\` menu item is correct, and you can see the accelerator next to it, it's working as expected.
> - Added a patch for \[eclipse-theia/theia#11600\](https://github.com/eclipse-theia/theia/issues/11600). Steps to verify:
> - Start IDE2,
> - Select \`Reload Window\` from the \_Command Palette\_,
> - Create a new sketch,
> - It works.
> - Added a patch for \[eclipse-theia/theia#11853\](https://github.com/eclipse-theia/theia/pull/11853).
> - Revert patch for \[#1261\](https://github.com/arduino/arduino-ide/pull/1261). The fix is available from Theia. IDE2 must keep the selected language between sessions.
> - Disabled preference schema validation in the bundled to speed up startup: \[eclipse-theia/theia#11189\](https://github.com/eclipse-theia/theia/pull/11189).
> - Set \`editor.bracketPairColorization.enabled\` to \`false\` by default.
> - Removed all \`@theia/typehierarchy\` UI features from IDE2, (https://github.com/eclipse-theia/theia/commit/16c88a584bac37f5cf3cc5eb92ffdaa541bda5be)
> - \[dev\]: Removed \`webpack.config.js\` from Git. They're not required anymore.
> - \[dev\]: Removed \`depcheck\` plugin from packager. \`depcheck\` unreliably marked npm packages as unused and filtered them out. It's because Theia uses dynamic \`require\` calls, and tools (such as \`depcheck\`) cannot detect whether a module is needed at runtime.
> - \[dev\]: Improved packager's dev experience when bundling fails.
> 
> Closes #1655
> Closes #1656
> 
> \### 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)

---

_[View the full topic](https://forum.arduino.cc/t/ide-2-0-3-double-tabs/1066585)._
