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

Extra blank window when IDE started via sketch file association #2688

Open
3 tasks done
per1234 opened this issue Apr 4, 2025 · 0 comments
Open
3 tasks done

Extra blank window when IDE started via sketch file association #2688

per1234 opened this issue Apr 4, 2025 · 0 comments
Labels
topic: theia Related to the Theia IDE framework type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Apr 4, 2025

Describe the problem

In addition to starting the Arduino IDE application directly, it can be started by opening a specific sketch file when sketches are associated with the Arduino IDE application.

🐛 When Arduino IDE is started by opening a sketch file, an additional blank window is opened. This is annoying to the users and might cause confusion.

To reproduce

  1. If Arduino IDE is running, select Arduino IDE > Quit Arduino IDE from the Arduino IDE menus.
    All Arduino IDE windows will close.
  2. Control-click on any .ino file from a sketch.
    A context menu will open.
  3. Select "Open With" from the menu.
    A submenu will open that allows you to select which application to use to open the file.
  4. Select the Arduino IDE application from the menu.

Arduino IDE starts, with the selected sketch open as expected.

🐛 However, an additional blank Arduino window also opens.

Expected behavior

Blank Arduino windows are not created.

Arduino IDE version

e36f393

Operating system

macOS

Operating system version

Sequoia

Additional context

I bisected the regression to 859d29d / #2654 (does not occur when using the build at the previous commit d298b3f).


Since this fault is similar to the one reported in #2678, I hoped this would also be fixed by #2686. However, the fault still occurs when using the tester build from that PR (e62764b).


The fault does not occur when I start Arduino IDE by passing the path of the sketch via a command line argument.


I see this in the logs when the fault occurs:

2025-04-04 12:27:30 (node:24650) UnhandledPromiseRejectionWarning: Error: Received 'open-file' event. Interrupting the default launch workflow.
    at App.<anonymous> (/Applications/arduino-tools/2.x/268-e36f393.app/Contents/Resources/app/lib/backend/electron-main.js:2:1218999)

The original reporter sees a dialog when the fault occurs:

Image

A JavaScript error occurred in the main process
Uncaught Exception:
TypeError: Object has been destroyed
at _.send (node:electron/js2c/browser_init:2:73448)
at t.nodeId.r.click (/Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/electron-main.js:5:29489)
at MenuItem.click (node:electron/js2c/browser_init:2:33700)
at a._executeCommand (node:electron/js2c/browser_init:2:39128)

Although I do encounter the blank window fault, I don't get that dialog.


Originally reported by @embedded-kiddie at https://forum.arduino.cc/t/a-javascript-error-occurred-in-the-main-process-when-i-open-some-ino-file/1370279

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: theia Related to the Theia IDE framework type: imperfection Perceived defect in any part of project labels Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: theia Related to the Theia IDE framework type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

1 participant