I made a typo in a new .ino tab in the IDE (Windows environment): a small character became uppercase. Unfortunately, RENAME compares the new name with the old name after making both names uppercase (or lowercase).
A workaround is renaming and adding an extra character, followed by a second rename action solves the problem ... but it could be more efficient and logical.
Thanks @hameltje . I have submitted a formal report to the Arduino IDE developers on your behalf:
opened 07:29AM - 01 Nov 23 UTC
topic: code
type: imperfection
Sketch tab rename consisting only of case changes prevented on case-insensitive … file systems
### Describe the problem
Windows and macOS (by default) use a [case insensitive file system](https://en.wikipedia.org/wiki/Case_sensitivity#In_filesystems), where from a user perspective there is no functional difference between a file named `foo` and `Foo`. However, filename case has a semantic significance and these file systems are "[case-preserving](https://en.wikipedia.org/wiki/Case_preservation)", meaning the user has control over case in file names.
The files of a sketch are represented by editor tabs in Arduino IDE. The files can be renamed by selecting "**Rename**" from the editor toolbar context menu.
Arduino IDE's "**Rename**" feature prohibits a rename operation under the following conditions:
- The new name differs only in case from the previous name
- The file system is case insensitive (or perhaps just macOS/Windows)
🐛 The user is forced to either resign themselves to a semantically sub-ideal filename or else use an alternative method for renaming the file, which will be inconvenient and might cause [other problems](https://github.com/arduino/arduino-ide/issues/482).
### To reproduce
#### Set Up
1. Use Arduino IDE on a macOS or Windows machine.
1. Click the ●●● icon on the editor toolbar.
The editor toolbar context menu will open.
1. Select "**New Tab**" from the menu.
The "**Name for new file**" dialog will open.
1. Type `foo` in the tab name field in the dialog.
1. Click the "**OK**" button.
A new editor tab named "foo.ino" is added in Arduino IDE.
#### Demo
1. Click the ●●● icon on the editor toolbar.
The editor toolbar context menu will open.
1. Select "**Rename**" from the menu.
The "**New name for file**" dialog will open.
1. Type `Foo` in the tab name field in the dialog.
🐛 An incorrect message is shown in the dialog:
> **'Foo.ino' already exists.**
🐛 The "**OK**" button in the dialog is disabled.
### Expected behavior
It is possible to change the case of sketch filenames via the Arduino IDE tab rename feature on all case-preserving file systems.
### Arduino IDE version
69b7365
### Operating system
- Windows
- macOS
### Operating system version
- Windows 11
- macOS Ventura
### Additional context
Originally reported at
<a name="workaround"></a>
#### Workaround
1. Use your file manager or terminal to rename the sketch file.
You will now see that the renamed tab has been duplicated in Arduino IDE (https://github.com/arduino/arduino-ide/issues/482). You can restore the IDE from this broken state by performing the following procedure:
1. Press the <kbd>**Ctrl**</kbd>+<kbd>**Shift**</kbd>+<kbd>**P**</kbd> keyboard shortcut (<kbd>**Command**</kbd>+<kbd>**Shift**</kbd>+<kbd>**P**</kbd> for macOS users) to open the "Command Palette".
A menu will appear on the editor toolbar:
![image](https://github.com/arduino/arduino-ide/assets/8572152/3bf1039b-9c62-4202-aaf9-33f7d935cb13)
1. Select the "**View: Reset Workbench Layout**" command from the menu.
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://www.arduino.cc/en/software#nightly-builds)
- [X] My report contains all necessary details
If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject:
system
Closed
April 29, 2024, 7:30am
3
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.