Opening a project/folder in a new state every time


#1

Hey guys, whenever I re-open a project (folder) it always remembers the state: the folder tree opened as it was, and any open documents are re-opened.

I’d like projects/folders to be open in a clean state: collapsed tree view, and no open documents. Is this possible?

I do have Open Empty Editor on Start checked (doesn’t effect opening a project).

Any ideas? Thanks!


#2

You’re looking for a different setting: Restore Previous Windows on Start.


#3

no, that’s something else-- that opens everything back up when I open Atom. I have that disabled.

Despite these two settings, when I manually re-open a folder I had had open previously, it resumes the state for that folder-- tree view, open files-- and I don’t want it to do that. Is this possible?


#4

That’s what disabling Restore Previous Windows on Start should be doing. Can you please share your config.cson here? Open Empty Editor on Start is rather unrelated (it toggles the setting for opening a literal “new tab” when starting Atom).


#5

You can start Atom with the switch --clear-window-state, which will eliminate all of that state information (as well as unsaved files).


#6

my confgi.cson:

"*":
  core:
    restorePreviousWindowsOnStart: false
    telemetryConsent: "limited"
  editor:
    fontFamily: "Menlo"
    fontSize: 13
    scrollPastEnd: true
    showIndentGuide: true
    tabLength: 4
  "tree-view":
    hideIgnoredNames: true
    hideVcsIgnoredFiles: true
  welcome:
    showOnStartup: false

You’re telling me this doesn’t happen for you? 1) Run Atom. 2) Open a folder. 3) Expand some directories in the tree view. Open a few files. 4) Quit Atom. 5) Re-open Atom, it’s empty, great. 6) Re-open that same folder, and boom all of the tree view expansion is restored, and the open files are re-opening.

That step 6 drives me nuts.


#7

No, everything works for me.

I think I may know what’s going on though - what’s your Atom version?


#8

OK, odd, I was 1.16.0 x64. Now I’m 1.17.0 and when I opened a folder it prompts me to add to window & discard state, or open new window and recover state; choosing the former opens the folder in a blank state.

It seems I’ll get this dialog every time I open a folder now? Is there a way to set ‘open in new window and discard state’ as the default behavior?