Loss of code on sleep

I was hesitant about moving to Arduino 2.X but thought I'd give it a try.

I don't like it. In particular it's reliance on internet resources.

I can be writing a program. It could be a huge creation. I go and make a coffee. My laptop goes to sleep & when i return my work is lost!

I believe this has been on a bug list for a long time?

Hi @myiot23.

That is correct. The bug is tracked here:

The workaround is to make sure to save your sketch before your computer sleeps. You can ensure this by checking the "Auto save" checkbox in the Arduino IDE preferences (File > Preferences). This will cause Arduino IDE to automatically save your sketch after every change.

What happens when it hibernates ?

'Sleep' is anyway a setting that does not fully stop power consumption (also not from peripherals) and can damage your battery by over discharging.

Clearly the computer needs the coffee, not you.