11

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?

5
  • "hot_exit": true, "remember_open_files": true
    – Taylan
    Aug 6, 2013 at 16:01
  • both of the above values are set to true by default.
    – mrudult
    Aug 6, 2013 at 16:35
  • 1
    How are you closing Sublime? CMD + Q, File->Quit ect..
    – spuder
    Aug 6, 2013 at 17:31
  • @spuder just going to the windows and clicking on 'x'
    – mrudult
    Aug 6, 2013 at 17:49
  • 1
    @spuder - that's it. Sublime isn't being closed all the way, just the windows are. See my comment below my answer :)
    – MattDMo
    Aug 6, 2013 at 17:57

3 Answers 3

10

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.

2
  • That worked. Thanks. I think that's coz of how the 'x' button beahves in Mac OS X. It actually doesn't close the application.
    – mrudult
    Aug 6, 2013 at 18:20
  • 1
    This works. But I gotta say, having to close the app in a different way for this to work is horrible.
    – Lombas
    Sep 23, 2016 at 12:31
5

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.

2
  • that's not working. :( When I set "create_window_on_startup:false" now it doesn't open any single windows when I start Sublime for the first time. I need to click it twice but still no files from last oepn session.
    – mrudult
    Aug 6, 2013 at 17:49
  • If you're closing the windows by just clicking on the red dot in the upper left, you're not really closing Sublime Text - it's still running in the Dock. Try opening a window, and opening several files in it. Then, hit command-q to close Sublime completely, then click on the Dock icon to open it up again. Your files should all reappear.
    – MattDMo
    Aug 6, 2013 at 17:56
1

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

1
  • Sorry but apparently this option is not even working in Yosemite! Mar 13, 2015 at 23:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .