Search code examples
sublimetext3

Sublime-Text Force to not load previous files


I've accidentally opened tons of files. The nice feature that Sublime loads all files which were open in the previous session becomes a problem at this moment.

So i've find a setting to disable this feature, so that i start with a clean session.

Prefrences/Settings/User

"hot_exit": false,
"remember_open_files": false,

However this doesn't help. When i open SB3, still it loads all the files which were open before. Maybe the config changes are not picked because i am killing the app instead of closing?


Solution

  • So the easiest way around this will be to delete your .sublime_session files. They should be located in the following places:

    • Linux: ~/.config/sublime-text-3/Local
    • OS X: ~/Library/Application Support/Sublime Text 3/Local
    • Windows: C:\Users\username\AppData\Roaming\Sublime Text 3\Local

    (I can confirm the first two, but I don't have access to a Windows box at the moment to confirm the last location. I'm reasonably sure that's its location, through.)

    Open the Local folder either via the command line or through your operating system's file manager (I'd recommend the command line for OS X and Linux as ~/Library and ~/.config are hidden by default). Make sure Sublime is closed, then delete Auto Save Session.sublime_session and Session.sublime_session. This will not only close all the windows and tabs you have open, but it will also remove the entries in the File -> Open Recent and Project -> Open Recent menus.