Suggestion: reload file from disk or monitor file changes

Nowadays, we use Git very often. After every git pull, the files get updated, but the IDE does not show the changes. Users have to manually close the IDE and reopen that file to show updated version, quite a waste of time.

Implementing file-system monitoring is complicated, but it is easy to add a button and a hotkey (say F5) to reload files from disk, that would be useful.

Hi @xuancong84. Which version of the Arduino IDE are you using?

This complicated file-system monitoring is already provided by Arduino IDE 2.x. There is no need for you to do any manual reloading of the sketch. It happens automagically.

There is only one condition where external changes to the number or contents of sketch files will not be updated in the Arduino IDE 2.x. That is when you have the "Auto save" preference turned off and there are unsaved changes in the sketch. In this case, the modified sketch is being staged rather than being the files on disk in the sketch folder. If there were external changes while the sketch is in this unsaved state, when you trigger a save, the IDE will warn you of the out of sync condition and ask whether you want to overwrite the changes made on disk.

Thanks @ptillisch , I was using Arduino 1.8.6. I have tested v2.0 IDE, file auto-reload is working great. Since I installed the AppImage as root, I wonder if a user updates libraries and hardwares, where are those new files stored?

You are welcome. I'm glad it is working for you now.

If you encounter any problems or have any feedback for the Arduino IDE 2.0.0 release candidate, please let us know.

Arduino IDE 2.x stores these files in the same location as 1.8.6:

  • ~/.arduino15
  • ~/Arduino/libraries

You can configure the ``~/Arduino` path via the "Sketchbook location" preference in the Arduino IDE's File > Preferences dialog.

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