Skip to content

${dirty} doesn't have any effect in window.title advanced settingΒ #1747

@per1234

Description

@per1234

Describe the problem

By default, Arduino IDE's "Auto save" preference is enabled. This causes changes made to a sketch in the Arduino IDE editor to be automatically saved soon after the user makes them.

The user may prefer to control if and when changes are saved, in which case they will disable this preference.

The IDE must communicate to the user when the sketch is in an unsaved (AKA "dirty") state. Currently this is done by appending a ⬀ symbol to the title of the tab containing unsaved changes. A common convention in applications is also to indicate the state via the window title. A sophisticated template-based window title customization capability is available by the window.title advanced setting, which promises to provide such a capability via the ${dirty} variable:

  • ${dirty}: an indicator for when the active editor has unsaved changes.

πŸ› An unsaved indicator is not added in the window title if the user adds a ${dirty} variable to their custom window title template in the window.title advanced setting

To reproduce

  1. Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
  2. Select the "Preferences: Open Settings (UI)" command from the menu.
  3. A "Preferences" tab will now open in the Arduino IDE main panel. In the "Search Settings" field, type window.title
  4. Change the content of the field under the "Title" setting to:
    ${dirty}${rootName}${activeEditorShort}${appName}
    
  5. Select File > Preferences from the Arduino IDE menus.
  6. Uncheck the checkbox next to the "β˜‘ Auto save" preference.
  7. Click the "OK" button.
  8. Make a change to the sketch content in the Arduino IDE editor.

πŸ› No "dirty" indicator appears on the window title:

image

Expected behavior

"Dirty" indicator is shown in window title if the window.title setting contains ${dirty} and selected editor tab is in an unsaved state.

Arduino IDE version

c4172ee

Operating system

Windows

Operating system version

10

Additional context

The setting works as expected in Theia Blueprint 1.31.1 (same version of Theia as in use by Arduino IDE):

image

This indicates to me the problem is caused by something in the Arduino IDE codebase.


Other customizations made to the window.title setting take effect as expected, so the general feature is functional.


Related 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