Don't open previously opened files on new start


#1

Every time I start atom, it opens up all the files I last had opened. I understand that this is a feature, not a bug, but I would like to be able to configure atom such that it does not do this, rather opens up nothing. In sublime, I can do something like this to achieve the behavior I’m after:

{
   "hot_exit": false,
   "remember_open_files": false
} 

Is there any such option in Atom yet?

Thanks!


Save/Reload work session
Old topic appears every time I start Atom --- want blank slate
Clean open?
Toggle Soft Wrap not working as expected
#2

how did you get it to do this?


#3

@lucascaro I didn’t, I’m ASKING how one would accomplish this behavior in atom. That example is in sublime.


#4

I can’t get it to reopen the files I had previously open, it starts empty every time. I know of a lot of people asking they add that feature (remember open files on exit), so It’s strange that you’re getting that behavior :smile:

And yeah +1 it should be configurable for sure.


#5

It would be awesome to have this bug/feature that opens last session (files and project) that was opened before I closed Atom. I love this feature in Sublime and having it configurable would give everybody an option to customize to their liking.


#6

Given you open atom from a folder using the CLI it’ll reload the last state of the editor (that’s the point of the package serialization API, you can see/manage atom dumps at .atom/storage), however, when launching Atom from the app folder it starts empty.


#7

I’m opening atom from the console, giving it either a directory or a file from that directory:

> atom .
> atom .\default.ps1

It restores all the tabs I had opened last time I opened that folder. I guess it’s what the thread is about.

I use atom to edit individual files mostly, so I never need stuff from the previous session. And due to my hard OCD, I hate having all these tabs opened when I only need to edit a single file.

So, I want atom to always start empty, is it possible?


#8

Not currently, though you could disable the tree view package … that might be a little drastic though. It will still open the same files you had open if you start in the same directory.


#9

You can put this in your init.coffee:

process.nextTick ->
  atom.workspace.getPaneItems().forEach ->
    atom.workspace.destroyActivePaneItem()

It closes all pane items after Atom started.


Don't remember tabs on startup?
Atom hangs on startup
Atom hangs on startup
#10

Hey, it works! I though it would close the file I asked it to open as well, but it didn’t. Thanks!
It’s not pretty, though, and it’s adding to startup time, which is not very instantaneous already. So, an setting in Atom would be cool.

Now I also noticed that the tree view is revealing itself on each startup. Is there a setting for it to always be hidden at startup? Or hiding it in init.coffee is once again the only way?

UPD: I swear I googled it before asking, but googling after posting the question is always more effective.


#11

No there isn’t, so yeah, you’ll have to do that in init.coffee


#12

Legendary, thanks olmokramer. +1 to putting a config option on the Settings page.


#13

Although it works, putting that code into init.coffee seems so hacky. In addition, doing this doesn’t make it start with an empty tree view…it still has the last folder pulled up. I would really vote for this being configurable in settings. Honestly, this is what keeps me going back to Sublime.


#14

thanks, this solved perfectly, how do you know how to interact with atom coffee scripts properties and methods? there is a reference for this?

thanks again


#15

I use the API documentation at https://atom.io/docs/api/latest, along with messing around in the devtools console


#16

This needs to be implemented! Someone look at it, please.


#17

Agreed, it is driving me crazy because I can’t use ST at work.


#18

Do we have a way to turn this off yet?


#19

Same here, the only reason I use both Atom and Sublime is because only Sublime can be configured to always start a clean interface. So, when I need to take a quick note, I open Sublime.


Atom keeps on opening non-existing file on startup
#20

Also a bit hacky, but you could create an alias that does rm ~/.atom/storage/editor-* before starting atom.