I have to send a screen capture to a company to get support, I have to move some folders around and then open the Arduino IDE on camera, thing is, I don't want them to see the last sketch (or any sketch for that matter) and Arduino always opens the last one, even when opening the Arduino zip with the sketchbook on a random folder, opens the last arduino sketch opened with the installed version. EVEN if I go to C:\Users\<user>\.arduinoIDE\recent-sketches.json and C:\Users\<user>\.arduinoIDE\recentworkspace.json delete everything in there and SOMEHOW manages to find again the last opened file, open it again and putting the information back into those files.
Like idk Arduino, maybe TAKE THE HINT, if I'm manually deleting data inside hidden configuration files, MAYBE I don't want you to open anything in those files!
Sorry for the rant, can you guys please help? this is driving me insane.
When it starts IDE 2.x opens the last sketch that was saved so all you have to do is to save a simple sketch, or an empty one for that matter, before opening it again
It is pointless to obsess over this. You are making a throwaway screencap that a random support technician is going to look at once, not a piece of fine cinema.
The Arduino IDE application has a sketch-per-window design. So you must have a sketch open to have the IDE open.
Or if you want to be more surgical, instead of deleting the file open it in a text editor and remove the content of the workspacesarray.
However, there isn't a point in doing that in this case because Arduino IDE will fallback to creating a new sketch if there isn't a previous sketch to restore. So it is more simple to use the approach provided by @UKHeliBob.
On the off chance you happen to be interested in the boring details of how the sketch restore system works, I'll mention there is a detailed explanation here.
It's not something I'd be driven insane, anyway before starting the screen recording, you might just create a "fake" Arduino using a batch file and an "empty" *.ino. It's something you can do just once.
Let's say your IDE is located at "c:\Users\<user>\AppData\Local\Programs\Arduino IDE\Arduino IDE.exe" where "" is your current Windows user.
Create an "empty.ino" file with the standard "new" ino, let's say it's "c:\Users\<user>\Documents\Arduino\empty\empty.ino"
Create an "arduino.bat" somewhere (e.g. your Documents folder) with this content (a single line!):
Now if you start the recording and double click that shortcut, the IDE will start with that "empty" code, and no one can tell if you did this trick or not.
Hope it helps.
Agree, and that's what I'd do. But if the OP just wants to mock it while recording, it's the way I thought about. Not a "final solution" but for what it's worth...
In this specific use case of only wanting to start Arduino IDE with a minimal or empty sketch one time, I think @UKHeliBob's approach is best due to being the most simple.
However, I would simplify it by just configuring the shortcut to pass the argument to the "empty" sketch instead of using a batch file for that purpose:
As with @docdoc's approach, when you start Arduino IDE via that file shortcut, it will open the sketch at the path you specified via the argument in the "Target" field instead of restoring the previous sketch.
The old version opened a new sketch each time with a temp name like "sketch_xxxxxx", when you hit save, it prompts you to save the file with a name you choose. The new feature is great and all but I think other than OP's specific case would be a nice option. And personally I don't think adding a checkbox that selects if you want to open a new file or the last one by default would take a developer more than 10-15 minutes to implement.
This is incorrect. Arduino IDE 1.x has the same sketch restoration behavior as Arduino IDE 2.x.
Both versions fall back to opening a new sketch if you didn't have a saved sketch open during the previous session, or if the sketch you had open is no longer accessible (e.g., you deleted the sketch between sessions).
The Arduino IDE developers are tracking the request for the addition of a setting to disable the sketch restore behavior here:
If you have a GitHub account, you can subscribe to that thread to get notifications of any new developments related to this subject:
Ah yes, you are right I remember now editing files to disable that behavior, but at least IT WAS POSSIBLE. Now it doesn't. Also the Github Issue doesn't have any updates since 2023 so... not expecting anything any time soon