70

I am on Lion - and in the command line, when I open up my project using "subl ." in my project folder - it opens up the last project I had open before I quit Sublime.

I have the Max Preference "Restore windows when quitting" unchecked.

How to I prevent this behaviour? Is there a preference setting for this?

Joerg
  • 3,553
  • 4
  • 32
  • 41

4 Answers4

122

I think the behavior you want can be enabled by changing the hot_exit and remember_open_files settings. If you check out the "Global Settings - Default" preferences, there are some comments there describing these settings.

If you want to change them, you should override them in the "Global Settings - User" file to preserve your changes across updates.

Sean Carpenter
  • 7,681
  • 3
  • 37
  • 38
  • 1
    Hmm - I've added both of them and set them to false - but on restarting - if I look in the Window menu - I can see all the previous projects/files I had opened in the past ... do I need to clear that list somehow first? It doesn't look like it is having much effect - though searching on Google on those settings, they do exist - so thanks for that. – Joerg Oct 25 '11 at 14:15
  • Ah - it works when I enter it in "Global Settings - User" - as opposed to File Settings - User ... I think it's just a typo in your answer. – Joerg Oct 26 '11 at 10:59
  • Cool thanks - I tried to edit it as well - but it was rejected by the moderators for some reason. – Joerg Oct 27 '11 at 12:26
  • 3
    Thank you! Preferences > Settings Default then set the both mentioned values to 'false'. – Denis Oct 03 '12 at 09:34
  • Thanks. This has been driving me crazy. For some reason it was enabled on my linux machine, but not my mac. – John Carter Feb 11 '13 at 15:15
  • This is still the correct way to disable this feature as of July 2013 – William Isted Jul 04 '13 at 13:49
  • Apparently, Preferences > Settings Default is the place to set both hot_exit and remember_open_files to false, and this works as of early August 2013. I tried setting them to false in Preferences > Settings User, but strangely, using "sublime folder_name" in terminal didn't open that folder in sublime anymore. – dmonopoly Aug 04 '13 at 14:49
  • This fix the problem of opening a new window, but it would be cool to have the behavior atom editor gives you, that is when you switch directories it actually returns to the file you have opened in that directory. It keeps some sort of history between directories. – Gerardo Feb 11 '15 at 23:10
  • Is there a way to disable it temporarily, through a keypress perhaps? I presently can't launch the app because it crashes trying to launch the most recent state. – 2540625 Jun 08 '16 at 17:23
  • Looks like remember_open_files is gone in version 3 build 3114. Simply disabling hot_exit does the trick. – hcoverlambda Jul 15 '16 at 19:24
29

If anyone is wondering how to do this in sublime text 3, copy and paste the following into settings - user:

"hot_exit": false,
"remember_open_files": false,
Chris Krycho
  • 3,125
  • 1
  • 23
  • 35
MIke Wizowski
  • 299
  • 3
  • 2
  • 5
    `remember_open_files` doesn't exist in build 3083 but setting `hot_exit` to false does solves the original question. – zigojacko Jun 09 '15 at 13:40
10

I could only get it to work by also setting "hot_exit": false in my preferences.

JJD
  • 50,076
  • 60
  • 203
  • 339
Raindog
  • 101
  • 1
  • 2
  • 1
    As per the comments in the default prefs: "remember_open_files makes the application start up with the last set of open files. Changing this to false will have no effect if hot_exit is true" – Aaron Gibralter Jul 22 '14 at 23:31
1

On Linux, I had an issue where I couldn't even start Sublime Text 3 because there were too many files open and it would hang before I got a chance to change the settings.

I did what Mike Wizowski suggested and edited my $HOME/.config/sublime-text-3/Packages/User/Preferences.sublime-settings to include those settings.

However, restarting Sublime Text after this did not seem to fix my problem because Sublime still opened all the files and folders.

I found that deleting the 2 ".sublime_session" files in $HOME/.config/sublime-text-3/Local/ made Sublime Text forget what the recently opened files/folders were, thus fixing my hanging text editor.

KevinL
  • 1,238
  • 11
  • 28