Skip to content

Additional sketches can't be opened via file association/command line argument #1590

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

Closed
3 tasks done
per1234 opened this issue Oct 28, 2022 · 2 comments · Fixed by #1617
Closed
3 tasks done

Additional sketches can't be opened via file association/command line argument #1590

per1234 opened this issue Oct 28, 2022 · 2 comments · Fixed by #1617
Assignees
Labels
conclusion: resolved Issue was resolved 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 Oct 28, 2022

Describe the problem

In addition to opening them via the Arduino IDE GUI, sketches can be opened directly either via file association or by passing their path to the IDE command line invocation.

🐛 This only works once per IDE session. After that, attempting to open additional sketches in this manner has no effect.

To reproduce

  1. Select File > Quit from the Arduino IDE menus if it is running.
  2. Open a sketch via file association or command line argument:
    & ".\Arduino IDE" "C:\Users\per\Documents\Arduino\Foo"
    
    🙂 The IDE starts up with the specified sketch open, as expected.
  3. Open a different sketch via file association or command line argument:
    & ".\Arduino IDE" "C:\Users\per\Documents\Arduino\Bar"
    

🐛 The command exits immediately with no effect. The specified sketch is not opened in an IDE window.

Expected behavior

Additional sketches can be opened via file association or command line argument when the IDE is already running.

Arduino IDE version

2.0.1

Operating system

  • Windows
  • Linux

Operating system version

  • Windows 10
  • Ubuntu 20.04

Additional context

I bisected the regression to 2b2463b / #1563


Originally reported at https://forum.arduino.cc/t/arduino-ide-2-0-1-is-now-available/1046764/7

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 Oct 28, 2022
@kittaakos
Copy link
Contributor

Expected behavior

Additional sketches can be opened via file association or command line argument when the IDE is already running.

Additional context

I bisected the regression to 2b2463b / #1563

It does not work for me with 2.0.0 either. The second window never opens, and the first never opens to the correct sketch. I gave absolute paths to the main sketch file and folder, but neither worked. IDE2 opened a different sketch. This is on macOS with 2.0.0

@kittaakos
Copy link
Contributor

kittaakos pushed a commit that referenced this issue Nov 2, 2022
If the resource is a file, do not try to `readdir`, but return undefined

Closes #1590

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Nov 10, 2022
If the resource is a file, do not try to `readdir`, but return undefined

Closes #1590

Signed-off-by: Akos Kitta <[email protected]>
@per1234 per1234 added type: enhancement Proposed improvement conclusion: resolved Issue was resolved and removed type: enhancement Proposed improvement labels Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants