Another really irritating feature of Arduino IDE 2.x.x

You had it right with version 1.8.x

And what has been done with 2.x.x IS NOT an improvement!

  1. Your sketch folder and library folder are located on an external USB drive.
  2. You have your sketch open with multiple tabs/source files.
  3. The USB plug for the external USB drive gets bumped and the drive goes off line.
  4. Arduino IDE then dumps all the tabs and you wind up with an empty IDE.
  5. There is no way to reload them - you have to exit the IDE and restart it (double click on the .ini file again. Or File->Open the sketch again. Either way you have to wait for the whole IDE and sketch to reload from scratch again.

When you have a loose USB plug on a laptop this can happen quite a lot.

And it is frigging annoying!

IDE version 1.8.x did nothing if the USB drive went offline.
If you tried to save then it would simply tell you the sketch folder no longer existed.
But when you fixed the USB plug and the drive came back online then the IDE would save the sketch as normal.

Your topic has been moved to the IDE 2.x category of the forum