Unable to open multiple sessions on the same sketch

I want to be able to upload and serial-monitor several arduino's running the same sketch.
If I open a second instance of the IDE, if I switch it to the same sketch opened on another IDE, it takes me to the other IDE rather than letting me have two. Most frustrating.

If we assume Windows, did you open a NEW window and then start the second IDE?
Paul

Hi @StephenJD. If you would like to bring this to the attention of the developers you can submit an issue on the Arduino IDE 2.x repository here:
https://github.com/arduino/arduino-ide/issues/new?labels=type%3A+enhancement&template=feature_request.md

You should always do a search of the existing issues before making a new one to avoid duplicates, However, I just did some searching and didn't find anything about this particular subject.

1 Like

@StephenJD's issue report:

Thanks!

For monitoring serial ports, use a serial terminal application like Putty or Tera Term. The serial monitor in the IDE is basically just a simple educational tool.

Also please answer the question in reply #2.

I suspect reply 2 was based on how the classic Arduino IDE works.

The classic Arduino IDE has two distinct behaviors based on how the window was created:

If multiple windows of the same instance are created via the IDE menus (i.e., File > New, File > Open..., , File > Open Recent, File > Sketchbook, File > Examples), then each window shares the same board and port selection and the same Serial Monitor.

If multiple instances of the IDE are created by opening the IDE multiple times, either by running the IDE executable directly, or by opening a sketch file directly, then each instance has its own independent board, port, and Serial Monitor.

In Arduino IDE 2.x, each window is an independent instance no matter how it was created. So each window has its own board, port, and serial monitor selection. You can't start the Arduino IDE twice. So the question in reply 2 doesn't really make sense in the context of how Arduino IDE 2.x works.

Arduino IDE 2.x has the same behavior as VS Code in that if you try to open a folder or workspace again in a new window, it just switches you to the existing window that already has that folder or workspace open. It is possible to duplicate the workspace in VS Code via the "Workspaces: Duplicate As Workspace in New Window" command, but I don't see an equivalent in Arduino IDE 2.x (likely because the underlying Eclipse Theia IDE framework doesn't provide it).

Yes.
Paul

I cannot find a way of opening two windows on the same sketch. File->open reverts to the existing instance. If I dbl-click on the same sketch in explorer, it opens the original IDE. V1.8 of the IDE allows multiple windows on the same sketch.

No wonder, think of the synchronization issues that could arise.

Synchronisation is not a problem. The IDE reads and uploads any modified file before compiling it. I've been doing this for years with no problems.

But you could make changes to one window, leave and make changes to the second window, compile and the changes made to the first one would be lost.

Or, make changes to a first window, compile and decide it's not working, open the second window and fix the changes, compile and close. Later, see the unsaved first window... oops I forget to save it. Now I've overwritten the fixed sketch with the bad one... The Arduino has a working sketch but the original file is lost.

Indeed you could. You could jump in front of a bus and get run over.
C/C++ does not claim to offer protection to those intent on self-destruction, it does, however seek to make useful things possible.
It is very useful, when developing sketches to be able to test them on multiple boards, or to write a shetch that allow boards to talk to each other. In both scenarios you want the same sketch on multiple ports.
I can do this using IDE 1.8. Why not on IDE 2.0?

You are missing the point. You are speaking like a developer. Most of the people using the IDE are beginners. They don't need this feature, and there is a good possibility it could lead them to confusion and/or data loss because they don't understand or expect this behaviour.

In fact, most desktops apps prohibit this behaviour. If you open a spreadsheet in LibreOffice, and then open it again in another invocation of LibreOffice, it does not open the file, instead it changes focus to the already open document. It does this because it is the safe thing to do, it avoids setting the user up for taking actions that are unintended, without any warning.

I'm pretty sure this is normal, accepted behaviour for any app that opens files in write mode in a GUI.

The analogy of C/C++ flexibility is a huge stretch, it's not comparable.