Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sketch tab rename consisting only of case changes prevented on case-insensitive file systems #2272

Open
3 tasks done
per1234 opened this issue Nov 1, 2023 · 0 comments
Open
3 tasks done
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Nov 1, 2023

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, 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", 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.

To reproduce

Set Up

  1. Use Arduino IDE on a macOS or Windows machine.
  2. Click the ●●● icon on the editor toolbar.
    The editor toolbar context menu will open.
  3. Select "New Tab" from the menu.
    The "Name for new file" dialog will open.
  4. Type foo in the tab name field in the dialog.
  5. 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.
  2. Select "Rename" from the menu.
    The "New name for file" dialog will open.
  3. 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

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 (#482). You can restore the IDE from this broken state by performing the following procedure:

  1. Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
    A menu will appear on the editor toolbar:
    image
  2. Select the "View: Reset Workbench Layout" command from the menu.

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

1 participant