[IDE 2.0.3]Double tabs

This happened the first time a while ago after I upgraded from IDE 2.0.2 to 2.0.3. After that it was fine till this afternoon.

I did find an older closed issue on github (Selecting sketch file with double-click results in duplicate tabs · Issue #656 · arduino/arduino-ide · GitHub), not sure if it's the same issue.

I noticed the double tabs this afternoon again; todays sequence of events

  1. Started Windows 10 PC this morning at an indecent time
  2. Worked a bit in the IDE
  3. Shutdown just before 4 am
  4. Started Windows PC again at approx. 8 am
  5. Ran Windows update
    It ran into an issue (no idea what), PC rebooted and Windows updated restarted itself and completed succesfully.
  6. Started IDE 2.0.3, I did not observe any problems.
  7. Shutdown PC just before 12:00.
  8. Started PC again after 16:00
  9. Started IDE 2.0.3 and observed double tabs with the same sketch name for the sketch that I was working on.
  10. Closed IDE.

Image taken from nightly build, 2.0.3 is the same

OriginalSketch

Note
The sketch in the left tab has the cursor on the first line of the sketch
The sketch in the right tab has the cursor on the line where I probably left off.

Searched for files in AppData that contained double2float
Deleted C:\Users\Wim\.arduinoIDE\recent-sketches.json and C:\Users\Wim\.arduinoIDE\recentworkspace.json
Deleted C:\Users\Wim\AppData\Roaming\arduino-ide\config.json
Restarted the IDE, it opens with a double tab for the new sketch
Opening the double2float.0.1.ino using the menu file → open resulted in the double tab again
Closed the IDE

  1. Installed nightly build
  2. Cleaned out all the crap that I'm aware off that the IDE leaves behind in different places (mostly in C:\Users\Wim\AppData\Local\Temp); might have left something, not sure.
  3. Started the nighltly build, still the same double tab.

Other observations
If I open an older existing sketch that wasn't opened for a while, there is no issue with that sketch (no double tab). However using <ctrl><N> to open a new one again shows a double tab.

FileNew

attached

  1. old.log; copy of log at the moment that I noticed the issue
  2. log: anything after that

2022-12-17_log.log (1014.1 KB)
2022-12-17_log.old.log (1.5 MB)

I would just like to say that due to this problem I created myself an account, so that I can reply here on the forums :slight_smile: So let me add to this by actually simplifying it: the problem appeared to me on a computer with a fresh installation of Win10, after obviously installing Arduino IDE 2.0.3 for the first time. No matter what sketch I open or if I just create a new one, the double tabs are always there. Unlike the original poster's case, it has nothing to do with when the IDE was last opened or when the sketches were last modified. For me it is a permanent issue on this laptop (again, fresh Windows 10 and fresh Arduino IDE), while on 2 other laptops this problem never occurred :frowning:.

Yes, I am having the same issue as of today (26.12.22). It doesn't seem to affect functionality.

I have spend some time to try to figure out under which conditions this is exactly happening. The sequence of events in the opening post does not seem to have been de cause.

I suspected a board package that I once installed to help somebody on the forum. This resulted in a clone Nano's port (old bootloader, CH340) being detected as a Thinary Nano (a 4808 based board). Package removed, issue still there.

I have tried to change board/port using the dropdown when creating new sketches with out conclusive results

I had about 5 Arduinos connected (Mega, Uno, Micro, Leonardo and SparkFun Pro Micro), disconnected them except for one. Issue still occured.

I've tried to observe the sequence of events in the status bar (right bottom) but it's difficult to keep an eye on the loading of the file, teh syntax highlighting and the recognition of a board at the same time.

I have also tried to limit the naming of my directories (not nesting too deep, not using the same basenames) to no avail.

The log files clearly show that two tabs with the same file are open but with different 'settings' for the innerWidgetState.
E.g.

    "mainPanel": {
        "main": {
            "type": "tab-area",
            "widgets": [
                {
                    "constructionOptions": {
                        "factoryId": "code-editor-opener",
                        "options": {
                            "counter": 0,
                            "kind": "navigatable",
                            "uri": "file:///c%3A/Users/Wim/Documents/Arduino/gerard20221229/P1sender/P1sender.0.2.progmem/P1sender.0.2.progmem.ino"
                        }
                    },
                    "innerWidgetState": "{\"cursorState\":[{\"inSelectionMode\":false,\"selectionStart\":{\"lineNumber\":1,\"column\":23},\"position\":{\"lineNumber\":1,\"column\":23}}],\"viewState\":{\"scrollLeft\":139,\"firstPosition\":{\"lineNumber\":1,\"column\":1},\"firstPositionDeltaTop\":0},\"contributionsState\":{\"editor.contrib.folding\":{\"lineCount\":73,\"provider\":\"indent\",\"foldedImports\":false},\"editor.contrib.wordHighlighter\":false}}"
                },
                {
                    "constructionOptions": {
                        "factoryId": "code-editor-opener",
                        "options": {
                            "counter": 1,
                            "kind": "navigatable",
                            "uri": "file:///c%3A/Users/Wim/Documents/Arduino/gerard20221229/P1sender/P1sender.0.2.progmem/P1sender.0.2.progmem.ino"
                        }
                    },
                    "innerWidgetState": "{\"cursorState\":[{\"inSelectionMode\":false,\"selectionStart\":{\"lineNumber\":73,\"column\":1},\"position\":{\"lineNumber\":73,\"column\":1}}],\"viewState\":{\"scrollLeft\":0,\"firstPosition\":{\"lineNumber\":56,\"column\":1},\"firstPositionDeltaTop\":-16},\"contributionsState\":{\"editor.contrib.folding\":{\"lineCount\":73,\"provider\":\"indent\",\"foldedImports\":false},\"editor.contrib.wordHighlighter\":false}}"
                },
                {
                    "constructionOptions": {
                        "factoryId": "code-editor-opener",
                        "options": {
                            "counter": 1,
                            "kind": "navigatable",
                            "uri": "file:///c%3A/Users/Wim/Documents/Arduino/gerard20221229/P1sender/P1sender.0.2.progmem/telegrams.h"
                        }
                    },
                    "innerWidgetState": "{\"cursorState\":[{\"inSelectionMode\":false,\"selectionStart\":{\"lineNumber\":72,\"column\":5},\"position\":{\"lineNumber\":72,\"column\":5}}],\"viewState\":{\"scrollLeft\":0,\"firstPosition\":{\"lineNumber\":42,\"column\":1},\"firstPositionDeltaTop\":-17},\"contributionsState\":{\"editor.contrib.folding\":{\"lineCount\":74,\"provider\":\"indent\",\"foldedImports\":false},\"editor.contrib.wordHighlighter\":false}}"
                }
            ],
            "currentIndex": 2
        }
    },

@ptillisch, is there any way to get more debugging info out (e.g. grpc)? Not saying that I can find anything is that unknown territory :wink: But with all this randomness it's difficult to submit an issue on github.

Thanks for your reports everyone.

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

If you have a GitHub 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, 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:

1 Like

Thanks for the workaround; one annoyance less. And just to confirm, it works :wink:

The biggest problem is that it's unpredictable. Open a new file (<ctrl>N) and it opens in one or two tabs. Save the file and the number of tabs might change (from one to two or vice versa).

Yes, the workaround was successful for me.
I see the double tabs quite frequently when opening an IDE example file.
After performing the work around, I didn't get any double tabs on the next several files I opened.

1 Like

I repeatedly had this problem where the sketch file would be open in two tabs. This is in Arduino IDE version 2.0.3

I suspect the problem is the sketch file was stored in a file path that was about 165 chars long. The IDE may not allow for path strings to be that long.

This can be a problem if you are using the ELEGO folders to store your sketch file (because the paths are long).

I moved the sketch folder for this sketch file to another location, and the file now opens up in a single tab.

1 Like

Thank you for advice!
When I shortened the sketch name, the second tab dissapeared. In my case the max length of path was 97 char, but some time up to 111 char.

Met same error, after update to 2.0.4 still exist. Reset Workspace doesn't help, so I found Explorer via Strl+Shift+P (Ctrl+Shift+E overtaken by Spotify %) and closed duplicate tab in "Open Editors".
A bit tricky, so question is - why Explorer Icon is not shown by default?

I am running Arduino IDE 2.0.4 on Gentoo (Linux)+xfce4 . the IDE runs very slow and there are double tabs per file.
Nightly build made no difference.
I could not find a work around.

! I do not have the same problem using Debian Linux (xfce4)
I am feeling this could be a dependency issue and will check the ldd on my Debian machines.

Here are some more notes:
I am using Arduino IDE 2.0.4 downloaded and unzipped from https://www.arduino.cc/en/software/
I did not emerge arduino (dev-embedded/arduino
Latest version available: 1.8.19
Latest version installed: [ Not Installed ]

Also the IDE showing Double tabs per file.

I run the ide at /opt/arduino/arduino-ide
I've installed emerge --ask sys-devel/crossdev per Arduino - Gentoo Wiki

I can upload code to an arduino fine but the ide is very slow.

I have added manual png and arduino-ide.desktop code for xfce4 (init system)

Here is the ldd
Code:

yoda /opt/arduino # ldd arduino-ide
linux-vdso.so.1 (0x00007ffdb55c3000)
libffmpeg.so => /opt/arduino/./libffmpeg.so (0x00007fd058735000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fd058720000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd05871b000)
libgmodule-2.0.so.0 => /usr/lib64/libgmodule-2.0.so.0 (0x00007fd058715000)
libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007fd0586b5000)
libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007fd05857b000)
libxshmfence.so.1 => /usr/lib64/libxshmfence.so.1 (0x00007fd058574000)
libgio-2.0.so.0 => /usr/lib64/libgio-2.0.so.0 (0x00007fd058394000)
libnss3.so => /usr/lib64/libnss3.so (0x00007fd05825a000)
libnssutil3.so => /usr/lib64/libnssutil3.so (0x00007fd058228000)
libsmime3.so => /usr/lib64/libsmime3.so (0x00007fd0581fd000)
libnspr4.so => /usr/lib64/libnspr4.so (0x00007fd0581ba000)
libatk-1.0.so.0 => /usr/lib64/libatk-1.0.so.0 (0x00007fd05818e000)
libatk-bridge-2.0.so.0 => /usr/lib64/libatk-bridge-2.0.so.0 (0x00007fd058151000)
libdbus-1.so.3 => /usr/lib64/libdbus-1.so.3 (0x00007fd058104000)
libdrm.so.2 => /usr/lib64/libdrm.so.2 (0x00007fd0580ee000)
libgtk-3.so.0 => /usr/lib64/libgtk-3.so.0 (0x00007fd0578a8000)
libpango-1.0.so.0 => /usr/lib64/libpango-1.0.so.0 (0x00007fd057840000)
libcairo.so.2 => /usr/lib64/libcairo.so.2 (0x00007fd057710000)
libgdk_pixbuf-2.0.so.0 => /usr/lib64/libgdk_pixbuf-2.0.so.0 (0x00007fd0576e2000)
libm.so.6 => /lib64/libm.so.6 (0x00007fd057603000)
libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007fd0574c1000)
libXcomposite.so.1 => /usr/lib64/libXcomposite.so.1 (0x00007fd0574bc000)
libXdamage.so.1 => /usr/lib64/libXdamage.so.1 (0x00007fd0574b7000)
libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007fd0574a0000)
libXfixes.so.3 => /usr/lib64/libXfixes.so.3 (0x00007fd057497000)
libXrandr.so.2 => /usr/lib64/libXrandr.so.2 (0x00007fd05748a000)
libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007fd057459000)
libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007fd05742f000)
libxkbcommon.so.0 => /usr/lib64/libxkbcommon.so.0 (0x00007fd0573e9000)
libgbm.so.1 => /usr/lib64/libgbm.so.1 (0x00007fd0573d6000)
libasound.so.2 => /usr/lib64/libasound.so.2 (0x00007fd0572ea000)
libatspi.so.0 => /usr/lib64/libatspi.so.0 (0x00007fd0572ad000)
libcups.so.2 => /usr/lib64/libcups.so.2 (0x00007fd057214000)
libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/12/libgcc_s.so.1 (0x00007fd0571f4000)
libc.so.6 => /lib64/libc.so.6 (0x00007fd057024000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd06178d000)
libffi.so.8 => /usr/lib64/libffi.so.8 (0x00007fd057016000)
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007fd056f79000)
libz.so.1 => /lib64/libz.so.1 (0x00007fd056f5f000)
libmount.so.1 => /lib64/libmount.so.1 (0x00007fd056efd000)
libplc4.so => /usr/lib64/libplc4.so (0x00007fd056ef6000)
libplds4.so => /usr/lib64/libplds4.so (0x00007fd056ef1000)
libgdk-3.so.0 => /usr/lib64/libgdk-3.so.0 (0x00007fd056e30000)
libpangocairo-1.0.so.0 => /usr/lib64/libpangocairo-1.0.so.0 (0x00007fd056e1f000)
libXi.so.6 => /usr/lib64/libXi.so.6 (0x00007fd056e0b000)
libcairo-gobject.so.2 => /usr/lib64/libcairo-gobject.so.2 (0x00007fd056e00000)
libepoxy.so.0 => /usr/lib64/libepoxy.so.0 (0x00007fd056cd1000)
libfribidi.so.0 => /usr/lib64/libfribidi.so.0 (0x00007fd056caf000)
libpangoft2-1.0.so.0 => /usr/lib64/libpangoft2-1.0.so.0 (0x00007fd056c97000)
libharfbuzz.so.0 => /usr/lib64/libharfbuzz.so.0 (0x00007fd056b91000)
libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007fd056b44000)
libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007fd056b0d000)
libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007fd056a44000)
libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x00007fd056a37000)
libxcb-render.so.0 => /usr/lib64/libxcb-render.so.0 (0x00007fd056a27000)
libxcb-shm.so.0 => /usr/lib64/libxcb-shm.so.0 (0x00007fd056a22000)
libpixman-1.so.0 => /usr/lib64/libpixman-1.so.0 (0x00007fd056979000)
libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x00007fd0568e7000)
libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007fd0568e0000)
libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007fd0568d8000)
libgnutls.so.30 => /usr/lib64/libgnutls.so.30 (0x00007fd0566da000)
libblkid.so.1 => /lib64/libblkid.so.1 (0x00007fd056682000)
libXcursor.so.1 => /usr/lib64/libXcursor.so.1 (0x00007fd056675000)
libgraphite2.so.3 => /usr/lib64/libgraphite2.so.3 (0x00007fd05664d000)
libbz2.so.1 => /lib64/libbz2.so.1 (0x00007fd05663a000)
libidn2.so.0 => /usr/lib64/libidn2.so.0 (0x00007fd0565e3000)
libunistring.so.2 => /usr/lib64/libunistring.so.2 (0x00007fd056461000)
libtasn1.so.6 => /usr/lib64/libtasn1.so.6 (0x00007fd056449000)
libnettle.so.8 => /usr/lib64/libnettle.so.8 (0x00007fd0563ff000)
libhogweed.so.6 => /usr/lib64/libhogweed.so.6 (0x00007fd0563b5000)
libgmp.so.10 => /usr/lib64/libgmp.so.10 (0x00007fd056317000)

On my gentoo linux machine running IDE 2.0.4 double tabs do not occur with line names with five charaters and a .ino . Example test0.ino does not double tab.

test_0.ino shows two tabls.

Not related to file name length in windows.
Blink

cattledog, this tells me its a desktop environment issue. Debian and Gentoo handle stable packages differently. My Debian boxes are fine.

See Arduino IDE 2.0.3 Duplicate TAB page for a workaround (post #2) and a workaround around the workaround (post #20).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.