Sublime Text 2 opens last opened files from last session

Whenever I open Sublime Text 2 on Fedora, it used to restore the last session.

But now in Mac OS X Mountain Lion, and it's not opening the window from the last session. What setting do I need to change?


The way that sublime is closed, determines the behavior.


Completely closing Sublime with

CMD + q

will cause sublime to cache the open files, and resume them on startup.


Closing just the window with

CMD + w

or

Shift + CMD + w

or

Clicking the red button close button in the corner

will cause Sublime to prompt to save the file. It will not reopen the last files.


Try setting

"create_window_at_startup": false,
"hot_exit": true, 
"remember_open_files": true

in your Packages/User/Preferences.sublime-settings file (accessible from the Sublime Text 2 -> Preferences -> Preferences - User menu). If they're there you can ensure that they're being applied. The hot_exit and remember_open_files settings should already be true by default, but create_window_at_startup also defaults to true, and setting it to false should do the trick. Probably what's happening is Sublime is creating the new, empty window on startup, but for some reason is not remembering the previously-opened files. I'd also double-check that your ~/Library/Application Support/Sublime Text 2/Packages directory hasn't been modified, deleted, set to read-only, or otherwise corrupted.


You can change this behavior in Mac by going to System Preferences / General and uncheck "Close windows when quitting an app"