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

Open Example, Close, Open again - appears to open copy in %temp% directory #1089

Closed
3 tasks done
KurtE opened this issue Jun 21, 2022 · 1 comment · Fixed by #1152
Closed
3 tasks done

Open Example, Close, Open again - appears to open copy in %temp% directory #1089

KurtE opened this issue Jun 21, 2022 · 1 comment · Fixed by #1152
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

@KurtE
Copy link

KurtE commented Jun 21, 2022

Describe the problem

With the new nightly builds, it looks, like the code that remembers what sketch window that was last closed and tries to reopen it when you restart, it then looks like it reopens the example sketch, which is good.

However what it appears to remember is the directory within your temp directory

Now suppose in between the time you closed the Arduino IDE and reopened the IDE, your folder within temp is no longer there.
Could be you run a disk cleanup, or maybe your rebooted and your temp is on a Ram drive or ...

Now your Arduino IDE comes up in a strange state, something like:
image

Note: it does not show the example sketch. Also in this case I had open the Sketchbook pane and it showed empty, but Files->Sketchbook does not show empty.

To reproduce

Open an example Sketch. In this case I opened MTP_Teensy->SD_MTP_debug but I don't think that maters.

Close the sketch: Ignore the error message (say no) about Save/Don't Save #1026

Clear out some of the folders within %temp% - like .arduinoIDE-unsaved*

Reopen the Arduino IDE

Expected behavior

I would expect that it would reopen the example sketch. Not the copy within the temp directory.

And/Or - would detect that the folder was not found and maybe inform the user of it and recover. Could either again go to the Example Sketch, Could bring up empty sketch or ???

Again would be easier for user to recover from this if the hiccup if like IDE 1.x you update the Recent sketch list, to
include the examples: #935

Arduino IDE version

Daily build: 20220621

Operating system

Windows

Operating system version

Windows 10

Additional context

Note: This is sort of a follow on and extension of my recent comments in #39

In particular, have the example open, go away for a couple of hours with the sketch open.
Have something like Norton running in background, which cleans up files. Now it clears out the files within the
.arduino... file in temp as the folder is in use so it can not delete it...

You then come back to an empty IDE (no file shown) and cryptic message
image
Full image of window in 39...

You then close the window and reopen and end up with similar to window I show in this issue, except it knows that it could not open the sketch...
image

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
@KurtE KurtE added the type: imperfection Perceived defect in any part of project label Jun 21, 2022
@kittaakos kittaakos self-assigned this Jun 22, 2022
@kittaakos kittaakos added the topic: code Related to content of the project itself label Jun 22, 2022
@per1234
Copy link
Contributor

per1234 commented Jun 22, 2022

Now your Arduino IDE comes up in a strange state

This can be reproduced via a simple procedure:

  1. Close all but one Arduino IDE windows
    This is done to simplify the demo because the IDE reopens all previous sketches on startup.
  2. Select File > Save As... from the Arduino IDE menus.
  3. Save the sketch to a convenient name and location.
  4. Select File > Quit from the Arduino IDE menus.
  5. Delete the sketch you saved in the previous step.
  6. Start the Arduino IDE.

The Arduino IDE will be in that "strange" state where there is no editor.

I bisected this to 4c55807

I would prefer the behavior of Arduino IDE 1.8.19, where if the previous sketch can't be opened on startup, a new sketch is loaded.

kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue Jul 6, 2022
kittaakos pushed a commit that referenced this issue Jul 8, 2022
kittaakos pushed a commit that referenced this issue Jul 8, 2022
kittaakos pushed a commit that referenced this issue Jul 14, 2022
kittaakos pushed a commit that referenced this issue Jul 18, 2022
kittaakos pushed a commit that referenced this issue Jul 18, 2022
kittaakos added a commit that referenced this issue Jul 18, 2022
IDE2 falls back to a new sketch if the opening fails.

Closes #1089

Signed-off-by: Akos Kitta <[email protected]>
@per1234 per1234 added the conclusion: resolved Issue was resolved label Jul 18, 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.

3 participants