As I understand it, dashes are allowed in sketch filenames. When I create a new sketch named MySketch_2025-05-04_01.ino and then perform a Save As to make a copy, where I'd like to manually bump the 01 to 02, the Save As form seeds the File name: field with something like MySketch_2025_05_04_01_copy_20250504132031, where the dashes are now underscores. I can change the underscores back to dashes before saving, and the new sketch/folder names honor those edits, but I have to change it every time I "Save As".
Why are the dashes changed to underscores? This is not new behavior for 2.x, but it's getting frustrating.
Also, is there an option to stop the IDE from modifying the name at all (meaning skip the appended "copy" + {time stamp}), as I wipe that out anyway.
Finally, I see the IDE does NOT prompt to avoid an accidental overwrite if I fail to bump the filename during my manual renaming - was this also intentional?
Thanks xfpd - after you have saved the sketch that has dashes (maybe try my exact filename), and you then select File > Save As..., the dashes are still in the filename?
As far as I know, the Auto Save option controls where or not the IDE saves changes made to the sketch automatically whenever you compile or close the IDE.
I am seeing the same problem with "Save As", with Arduino IDE 2.3.6 running on Ubuntu 24.04, although I get a prompt if the file name already exists.
Yeah, I must have goofed when I thought I had the same name in this scenario. It does have the ugly Windows behavior of browsing into the folder of that name when the name is unchanged, then expecting you to type in another filename. But if you somehow convince it that you really meant to save over the old file, it will warn you. I would say that when you are asked for a filename, then what you enter (During SAVE AS) should be interpreted as the FILENAME, and thus, it should NOT descend into the existing folder.
I added the dash before "copy" as the "save as" filename (and it kept that dash, but changed the other dashes), and the folder was created with the same title. Probably to be cross-platform for Linux, Apple and Windows.
Please only comment on the GitHub issue thread if you have new technical information that will assist with the resolution. General discussion and support requests are always welcome here on the Arduino Forum.
If you search "unix filename dash" you will see a lot of "how to delete a file with a dash in the name" and probably no "how to dash your filename"
There are two "dashes" in typography. The "en" dash (short) and the "em" dash (long). I think that might be a reason not to name a file with a dash... as well as the "command argument" mentioned. I am not a computerphile... I am just recalling nightmares from decades past, like a dog and a rolled up newpaper.