Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Atom closes without prompting to save #13861

Closed

Description

@RoverJOne

Hello,
I am using Atom 1.14.3 in Mint-17 64-bit and the following scenario causes Atom to close without prompting to save the modified file.

Core setting is:
"Restore previous windows on start" -- UNCHECKED
"Open Empty editor on start" -- CHECKED

Scenario 1 - With just one Untitled tab (as expected)

  1. Launch Atom editor from Menu
  2. In the Untitled tab (document), type something to make it into a modified but DO NOT save the document
  3. Close Atom and it will prompt you to save or to discard the Untitled document.

Scenario 2 - With one Untitled document + One unmodified file (The bug scenario)

  1. Launch Atom editor from Menu
  2. Open a document but do not modify it
  3. If TreeView is shown, toggle it off
  4. In the Untitled document, type something to modify it but do not save it. It does not matter how many "Untitled" documents are opened.
  5. Press Ctrl-Q or hit the X to close Atom. Atom does not prompt the user to save the Untitled document and simply discarding it and exit. OOPS! This is difference from Scenario 1.

I have been using an unmodified version of Atom other than to choose the themes from standard ones.

Rover

Activity

  1. winstliu commented on Feb 22, 2017

    @winstliu
    Contributor

    In the future, please completely fill out the issue template, or your issue will be closed without further action. For example, now I need to ask if you've experienced the same behavior in safe mode (atom --safe), and what the output of atom --version is, both of which are covered in the issue template.

    It does seem like we should always be prompting to save changes if "Restore previous windows on start" is disabled. /cc @iolsen

  2. RoverJOne commented on Feb 22, 2017

    @RoverJOne
    Author

    Hi iolsen,

    My apology for not following the protocol. It is my first time. If I may I have discovered more scenario that may help:
    If you have a number of Untitled document, it will prompt the user on closing.

    If you have a number of opened document and modified, Atom does not prompt on exit.

    The atom --version produces the following data:
    Atom : 1.14.3
    Electron: 1.3.13
    Chrome : 52.0.2743.82
    Node : 6.5.0

    There is no difference in behaviour with starting atom --safe or just atom

    Thanks
    Rover

  3. RoverJOne commented on Feb 23, 2017

    @RoverJOne
    Author
  4. RoverJOne commented on Feb 23, 2017

    @RoverJOne
    Author

    Hello,

    I created a virgin VM of Mint-17.3 (64-bit) using the distro's DVD ISO image (linuxmint-17-cinnamon-dvd-64bit.iso MD5=1c3fef2117fad9c9bc905abdeb474ac1)

    Then I updated the OS from Canonical (I can go back to try without update). Now the Operating system is as follows:
    3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014
    Cinnamon: 2.2.16
    Atom version:
    Atom : 1.14.3
    Electron: 1.3.13
    Chrome : 52.0.2743.82
    Node : 6.5.0

    This vm has an older version of Linux kernel than my other VM's but I do not believe an editor would be so sensitive to kernel version.

    I ran through the scenarios - one untitled modified document + 1 open document (not modified), etc and manage to repeat the problems - it did not prompt me if I want to save the untitled document.

    Atom is the only editor that exhibits this problem. I tested the scenario with Sublime 3 (with hot exit set to false), Kate and GEdit and they all well behave.

    I notice there is a CLI option --log-file. Is that useful to collect information to nail this problem? I am having trouble using this option. I tried --log-file=test.log but the file is not generated.

    Rover
    PS Tried to download your Win64 installer to test it in my Win7 VM but your Windows download site keeps timing out. So have to wait for another day.

  5. RoverJOne commented on Feb 23, 2017

    @RoverJOne
    Author

    Hello,

    I download the latest UBuntu 16.04.2 LTS Desktop 64-bit to create a brand new VM. Then installed Atom 1.14.3 and it fails the test in that VM. The only thing I have installed is the VMWare Tools.

    Atom version:
    Atom : 1.14.3
    Electron: 1.3.13
    Chrome : 52.0.2743.82
    Node : 6.5.0

    Ubuntu 16.04.2 LTS version
    4.8.0-36-generic #36~16.04.1-Ubuntu SMP Sun Feb 5 09:39:57 UTC 2017

    Thanks.

    Rover

  6. winstliu commented on Feb 23, 2017

    @winstliu
    Contributor

    Confirmed. Thanks for the detailed steps.

  7. ungb commented on Feb 23, 2017

    @ungb
    Contributor

    Thank @RoverJOne for the repro steps. If you reopen the folder you had before you should have your unsaved data. Can you try opening the folder from terminal (with no atom processes running) atom . from the directory you had open.

    I'm trying to understand this issue better. I believe we have a bug with opening any folder from the context menu from a empty editor. Also maybe we should have a option for Prompt for Save on Close, for those who like to always have it prompt for save, would be nice.

  8. winstliu commented on Feb 23, 2017

    @winstliu
    Contributor

    @ungb I believe the crux of the issue lies in the "Restore previous windows on start" option being unchecked. Therefore, project state is never restored, so we should prompt to save all changes before closing, because if we don't they're unrecoverable.

  9. ungb commented on Feb 23, 2017

    @ungb
    Contributor

    @50Wliu if you reopen the project, it works from when I try to repro, but not from the context menu. see #13873 which is probably the cause of multiple other bugs.

    From my understanding, Restore previous windows on start just opens the last project you had open when you open atom, it doesn't have anything to do with saving and not saving project sessions, but maybe if we do have this unchecked we want to prompt for save, but if you reopen that project from terminal with atom . with no Atom process running (bug #13873) this should work.

  10. RoverJOne commented on Feb 23, 2017

    @RoverJOne
    Author
  11. ungb commented on Feb 23, 2017

    @ungb
    Contributor

    let me spin up a mint linux distro tomorrow and try to repro. I am not seeing that on mac.

    My current settings:
    image

    GIF:
    test

  12. RoverJOne commented on Feb 23, 2017

    @RoverJOne
    Author
  13. ungb commented on Feb 23, 2017

    @ungb
    Contributor

    Sorry, Can you clarify? Which are you seeing on ubuntu? That you are able to see what I see in my comment (#13861 (comment)), or the same thing you see in mint linux(comment #13861 (comment))?

  14. RoverJOne commented on Feb 24, 2017

    @RoverJOne
    Author
  15. ungb commented on Feb 24, 2017

    @ungb
    Contributor

    Thanks for your prompt responses and feedback @RoverJOne! Sorry for the confusion, I wasn't trying to say that atom . was the fix to the issue, I was just trying to verify the behavior you are seeing and where the underlying data-loss issues is occurring.

    It seems like, you would like the editor to prompt you for unsaved changes if you have the option Restore previous windows on start unchecked, which I think is valid.

    I believe that having a separate option for Always Prompt to Save would be good to have as it seems that some people would rather always save their files on close than relying on the saved session regardless of if the previous windows will be loaded on start.

    Also, based on your scenarios looks like there might be other data-loss bugs. I'll spend some time investigate the scenarios you provided in comment #13861 (comment)

  16. lock commented on Apr 2, 2018

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  17. locked and limited conversation to collaborators on Apr 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions