Atom won't save my default file tree


Hello, I am having a bit of an issue… Atom never saves my file tree or last session when I close and reopen the application. Example: I start working on a navbar project for a friend, I write some markup, then save & close the app. When I return later, the project is still saved, but atom only slows a blank file, with no file tree as before. Its pretty annoying, since I like to get right to work when I open a text editor, but now I have to re-open the file tree every time. I set the default file tree in the settings as well. Any idea why this could be happening?


What operating system are you running?


Current version of macOS.


When you close Atom, are you closing the application completely, or just the window?


Either or will return the same result: A blank project page with no file tree. Should I try re-installing it?


No, because not all the avenues of investigation have been exhausted. When Atom is open and you have a project folder open in it, go to the .atom/storage/ directory in your user folder and check out the file application.json. There should be a file path there that matches the folder open in Atom. This file gets constantly updated, so if there is a path there when Atom is open but no path after Atom has been closed, that means that there was some point where Atom thought that it was open without any open project folders. If there is no path in application.json, then it could be that Atom doesn’t have permission to modify the file for whatever reason (and you should be able to delete it so that a new one gets generated).

Is this a recent issue or has Atom never remembered where you were for you?

(Side note: I don’t have a Mac, so I can’t attempt to replicate anything. However, a large proportion of Atom’s developers are Mac users and people have been running it on 10.12 Sierra for months, so we can rule out compatibility with the system as a potential cause.)


Actually, I just switched from Brackets. So I have no clue what’s normal and what’s not. I absolutely love Atom compared to it, just not if it can’t save my project file tree. I’ll try what you suggested.


Normal is for application.json to have content when the application is open and look the same after it’s been closed.


application.json has no paths, where should I go from here?


Delete it, reopen Atom, and see what happens.


Didn’t work.

Before closing Atom (file tree open):
After closing Atom (file tree closed):

What gives? :confused:

Macbook-Air:storage ryan$ rm application.json 
Macbook-Air:storage ryan$ ls
Macbook-Air:storage ryan$```

Deleted, still no luck.


Does a new application.json appear after you delete it? Does it have a path in it while Atom is open?


It reappeared. When Atom was closed, the file was blank, it only had two brackets: []
After I opened atom, it showed this: [{"initialPaths":[]}]

But the file tree remained blank, when I opened a new directory path manually, it said this: [{"initialPaths":["/Users/ryan/Documents/Web Development"]}]

When I closed Atom, again, it said this: []

Not sure where to go from here.


At this point, there are three things I would try, in this order:

  1. Open the Terminal and start Atom with the command atom --safe /Users/ryan/Documents to start it in safe mode. Close Atom completely and check application.json once more. This step will eliminate the possibility that a package is interfering with Atom saving the state.
  2. Reinstall Atom, delete the /Users/ryan/.atom folder, and see if the behavior changes.
  3. Ask people who are knowledgeable about the program and use Macs. @leedohm, do you have any thoughts on this thread?

If the first two steps don’t change anything and the others who use Mac don’t pipe up, you could open an issue on GitHub with a link to this thread and a description of the problem (application.json resets to [] on closing the program). In the issue body, you would rephrase the statement of the problem in your most recent post, while including version numbers and indicating that you have tried safe mode


atom --safe /Users/ryan/Documents says it isn’t a command, I tried variants of it such as using “open” before hand, none worked. So I decided to delete .atom and start over, which didn’t fix the issue. Any chance the command you listed above isn’t correct? Anything else I could try before opening an issue?


That’s my bad. I forgot that Mac users have to use a menu item to install the shell commands.


I started it in safe mode, and it opened my Documents file tree. The application.json shows the proper directory, however, if I then close Atom and reopen normally (not safe mode) it no longer saves the session.


When you reopened Atom in normal mode, did you see the Documents folder? If deleting .atom didn’t fix the problem, but safe mode did, then I have no idea what would be wrong. If you didn’t see the Documents folder when you reopened in normal mode, then safe mode didn’t fix it.


It consistently will show the Documents folder ONLY if I open it with atom --safe /Users/ryan/Documents

Opening it normally returns a blank window, no file tree. It’s quite bizarre.