Skip to content

Non-alphanumeric characters in sketch name replaced in "Save As..." dialog #2097

Open
@JanBluePix

Description

@JanBluePix

Describe the problem

The names of Arduino sketches may contain . and - characters in addition to basic alphanumeric characters.

🐛 . and - characters in the current sketch name are unnecessarily replaced with _ in the default sketch name that is prepopulated in the save as dialog.

To reproduce

  1. Select File > New Sketch from the Arduino IDE menus.
  2. Select File > Save As... from the Arduino IDE menus.
  3. Save the sketch to any location outside the sketchbook folder with the name foo.bar-baz
  4. Select File > Save As... from the Arduino IDE menus.

🐛 The sketch name prepopulated in the save as dialog is foo_bar_baz instead of the original foo.bar-baz

Expected behavior

The base sketch name is used verbatim in the prepopulated sketch name in the save as dialog.

Arduino IDE version

arduino-ide_nightly-20230612_Linux_64bit.AppImage

Operating system

  • Linux
  • Windows

Operating system version

  • Linux Kernel Version: 6.1.31-1-MANJARO (64-bit)
  • Windows 11

Additional context

A location outside the sketchbook folder was used in step (3) of the demo to avoid the introduction of the irrelevant complexity of the anti-collision suffix (e.g., _copy_20230612092238), but the fault of the unnecessary character replacements occurs even if the sketch is saved in the sketchbook at that step.

Additional reports

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions