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.

Quitting and re-opening Atom does not save the same tabs I had open #10044

Closed

Description

@snario

Whenever I quit Atom and re-open it, the same 3 tabs from something I was working on 6 months ago always open and not the thing I was just working on.

I have uninstalled and installed the save-session package multiple times, no luck.

This is version 1.3.1.

I'm guessing some file somewhere has these 3 files of mine saved and this file just never gets updated?

Activity

  1. lee-dohm commented on Dec 14, 2015

    @lee-dohm
    Contributor

    Atom automatically stores your "project" based on the list of project roots that were open when you closed it. So if you open Atom from the command line by executing atom ~/Source/foo, do some stuff and then close it and then later open Atom from the command line by executing atom ~/Source/bar, it will open a clean environment (assuming you've never opened bar before). It will keep the serialized state for each of these projects separately.

    Additionally, if you want to just open the last project you had open ... you can just click the Atom icon or start Atom from the command line with the command atom by itself.

    I don't know what the save-session package is supposed to do, I've never used it.

  2. winstliu commented on Dec 14, 2015

    @winstliu
    Contributor

    Hey @snario, try deleting the ~/.atom/storage folder as that contains the previous states of the editor (eg what tabs were open). In addition, you shouldn't need to have save-session installed anymore - in fact, all the functionality that was included in save-session is now in Atom 1.4.0-beta0.

    EDIT: @lee-dohm you're too quick for me 😆

  3. lee-dohm commented on Dec 14, 2015

    @lee-dohm
    Contributor

    Hehe ... I was actually going to add that information too, so I'm glad you replied @50Wliu 😆

  4. snario commented on Dec 14, 2015

    @snario
    Author

    You would think so @50Wliu but the project description says:

    Project Status: Undeprecated

    Since not all of Save Session's functionality has been added into Atom's core, Save Session is now undeprecated and has been modified to work with Atom 0.193.0. All that Save Session does now is manage unsaved files.

    (source: https://github.com/mpeterson2/save-session)

    Regardless, after rm -rf ~/.atom/storage my Atom now opens empty every time. Is this a permissions issue?

  5. snario commented on Dec 14, 2015

    @snario
    Author

    chmod -R a+rwx ~/.atom/storage does not fix it.

    EDIT: Sorry, @lee-dohm I didn't see your response, it must be that I am just not opening Atom the right way.

    EDIT 2: Nope. Still an issue. I tried:

    1. atom ., Atom opens
    2. I opened 5 or 6 files
    3. Quit atom
    4. atom ., Atom opens, no tabs are open
  6. winstliu commented on Dec 14, 2015

    @winstliu
    Contributor

    Sorry @snario, I should have clarified. Most of its functionality is in 1.3.0 - the only thing that wasn't was the auto-saving of untitled buffers, which was added in 1.4.0-beta0. It also doesn't seem to work with Atom 1.2 and above.

  7. added
    mac
    on Dec 17, 2015
  8. snario commented on Dec 17, 2015

    @snario
    Author

    @alexchandel's repro steps:

    1. Open Atom 1.3.2 on OS X 10.11.1.
    2. Add a project folder, leave some tabs open, and close Atom.
    3. Repeat Step 2 multiple times for extra fail
    4. Reopen Atom by double-clicking a file associated with it, outside any project. Atom completely forgets what was last open, and launches with A window open to double-clicked file's folder, with single tab for the double-clicked file.

    After Step 4, depending on the circumstances, Atom may recover A open project (for example by atom project/folder. However, double-clicking a file within that folder, or manually reopening a file, usually results in the open tabs being lost, and multiple open windows are always lost.

  9. snario commented on Dec 20, 2015

    @snario
    Author

    rm -rf ~/.atom/compile-cache seems to fix

  10. winstliu commented on Dec 20, 2015

    @winstliu
    Contributor

    @alexchandel can you try @snario's fix and see if that works? Thanks!

  11. jeoje commented on Jan 16, 2016

    @jeoje

    Thanks @snario -- This works in Windows as well. Deleting ~/.atom/compile-cache and ~/.atom/storage fixed this for me.

  12. alexchandel commented on Jan 19, 2016

    @alexchandel
    Contributor

    @50Wliu Doesn't work. It occasionally works if a single project window was open, although Atom (as usual) forgets whether the sidebar was open, and what my regex settings in Find/Replace were.

    However, it always fails when multiple windows/projects were open.

    Edit: in fact, it often recovers an old set of open tabs for the one project it remembers (i.e. not the same tabs that were just open, but some tabs from months ago). And if multiple projects were open, I've even seen it merge some of the tabs from each into the one project it restores.

  13. winstliu commented on Jan 19, 2016

    @winstliu
    Contributor

    @alexchandel Ok, then can you try removing ~/.atom/storage instead?

  14. cobyism commented on Jan 20, 2016

    @cobyism
    Contributor

    I was running into this as well, and running rm -rf ~/.atom/compile-cache fixed it for me immediately.

    Edit: Running on OSX, Atom 1.4.0

  15. 67 remaining items

  16. lee-dohm commented on Feb 8, 2017

    @lee-dohm
    Contributor

    Steps 1, 2 and 4 are covered by the standard debugging steps in the Debugging guide in the Atom Flight Manual. Unchecking "Open Empty Editor on Start" doesn't do what most people think it does, so I would be very surprised to hear that it fixes anything.

  17. jpalomaki commented on Feb 14, 2017

    @jpalomaki

    For me, Atom always spawned the settings tab even though I had closed it, opened new empty tabs and closed Atom.

    @Nandan108's rm -rf ~/.config/Atom/IndexedDB/* seems to have done the trick.

  18. pepperonas commented on Feb 22, 2017

    @pepperonas

    Even deleting the whole ~/.atom dir is 100% useless, tried it 2x (1x stable, 1x beta).
    At my sierra cmd+q provides the "typical-ide"-behavior. Using the red x isn't the best idea, if I want be productive.
    why not to use JetBrains good old sledgehammer phpStorm?! :)

  19. h2ku commented on Mar 9, 2017

    @h2ku

    Following link helped me to auto-save untitled tabs.
    https://discuss.atom.io/t/how-to-restore-your-previously-opened-tabs-even-non-saved-files/25035

    As it mentioned on the Save Session (Atom Package) web page the pkg has been deprecated.
    And the functionality has been merged to Atom core.

    The catch is Atom's 'project' concept. you have to add project folder to use the Save Session functionality. (also can open project using cmd like ~/.atom desired/dir)
    see this link for more info.

  20. pepperonas commented on Mar 15, 2017

    @pepperonas
  21. reimax commented on Mar 22, 2017

    @reimax

    atom 1.15
    re-opening editor does not save the open tabs and project folder

    rm -rf ~/.config/Atom/IndexedDB/

    fix this bug

  22. pwnall commented on Jun 8, 2017

    @pwnall

    I ran into a similar issue. After running a dev build of Atom, I couldn't do any work in one of my projects. Dev Tools showed a promise rejection with the message "The workspace can only contain one instance of item [object Object]".

    I tried removing things, and I was able to get back to work after rm -rf ~/Library/Application\ Support/Atom/IndexedDB. Posting the comment here because this is where I found the solution. Any chance that --safe could blow up the IndexedDB databases? I think the AtomEnvironments db was the source of my troubles, but wiping everything seems pretty safe.

  23. lee-dohm commented on Jun 9, 2017

    @lee-dohm
    Contributor

    Any chance that --safe could blow up the IndexedDB databases?

    No. The point of --safe is to help determine if a problem is due to a community package or Atom itself. Making Safe Mode change state would then make it impossible in some cases for Safe Mode to do its intended job.

    If you want to clear Atom's saved state, then use --clear-window-state as documented in the Atom Flight Manual.

  24. wbkoetsier commented on Jul 31, 2017

    @wbkoetsier

    Since a couple of weeks my Atom (1.18.0 now, but problem started in 1.17.2) will always start with the Settings openend, at Packages. I had this one tab open once and it seems to have gotten stuck there.

    I tried:

    rm -rf ~/.atom/storage
    rm -rf ~/.atom/compile-cache
    Atom -> Preferences -> Settings -> Uncheck "Open Empty Editor On Start"
    

    Did not work.

    I would like to try:

    rm -rf ~/.config/Atom/IndexedDB/*
    

    However, I'm on Windows (10 x64) and I was unable to find the equivalent file or folder. (find -type f -iwholename "*atom*indexeddb") My Windows experience is not nearly enough to figure that out. Can anyone tell me which file or folder I should delete to get the same effect?

    In case it is of any help:

    It also makes no difference whether I start Atom by double clicking atom.exe from C:\Users\me\AppData\Local\atom, C:\Users\me\AppData\Local\atom\app-1.17.2 or C:\Users\me\AppData\Local\atom\app-1.18.0.

    I tried starting Atom using the atom.cmd from C:\Users\me\AppData\Local\atom\app-1.18.0\resources\cli and I noticed that app-1.18.0\resources\app\apm\bin\node.exe is started with C:\Users\me\AppData\Local\atom\app-1.18.0\resources\cli\atom.js (and with the Settings open at Packages instead of my previously open tabs). I'm not entirely sure if this is what always happens when I start atom.exe from one of the folders above or from the start menu.

  25. lee-dohm commented on Jul 31, 2017

    @lee-dohm
    Contributor

    @wbkoetsier As I stated in my last message: If you want to clear Atom's saved state, then use --clear-window-state as documented in the Atom Flight Manual.

  26. wbkoetsier commented on Aug 1, 2017

    @wbkoetsier

    I can confirm that calling atom with --clear-window-state did the trick for me. I'll keep an eye on it, see if and when this problem occurs again.

    @lee-dohm thanks for the reply. I didn't realise that this is basically the same as removing 'indexedDB'.

  27. ninjabourbon commented on Oct 19, 2017

    @ninjabourbon

    I am sure lots of these comments have solved this issue, but I did a search and couldn't find the steps I took...
    I have the package "restore-windows" installed...
    then by deleting the file in .atom/restore-windows/mayBeRestored my problem was solved!

  28. lock commented on Apr 17, 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!

  29. locked and limited conversation to collaborators on Apr 17, 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