Atom won't save my default file tree


#1

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?


#2

What operating system are you running?


#3

Current version of macOS.


#4

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


#5

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


#6

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.)


#7

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.


#8

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


#9

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


#10

Delete it, reopen Atom, and see what happens.


#11

Didn’t work.

Before closing Atom (file tree open): https://i.imgur.com/1m1DV2j.png
After closing Atom (file tree closed): https://i.imgur.com/cx57T1h.png

What gives? :confused:


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

Deleted, still no luck.

#14

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


#15

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.


#16

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


#17

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?


#18

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


#19

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.


#20

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.


#21

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.