Sublime Forum

Disable automatic loading of last session


How can I tell Sublime not to open previously-open directories when I launch it? My ideal workflow would be

$ cd path/where/I/want/to/work $ subl .

After doing that, it’s a pain to have to close other windows that come up automatically. I’m guessing there’s a magic setting I can toggle somewhere?

1 Like

Forgiving history when opening the first window

I figured it out. In Packages/User/Global.sublime-settings, the following lines got me what I want:

{ "hot_exit": false, "remember_open_files": false }



Is it possible to change these setting from command line rather than editing the setting permanently in sublime?

For when I have 2 or 3 projects in sublime but want a new folder to open in sublime without those previous projects and don’t want the new project to overwrite sublime_session when I close the window. That way when I open sublimetext normally it will still have those 2 or 3 other projects?

It seems simple from the command line perspective. Just a option to ignore last session and don’t write session. But I don’t know how difficult it would be to implement in sublime if it doesn’t already exist.


1 Like


So, guys, any progress?

It really seems to be a tiny change — only add a command switch to ‘subl’ to ignore last session.

1 Like


[quote=“constantius”]So, guys, any progress?

It really seems to be a tiny change — only add a command switch to ‘subl’ to ignore last session.[/quote]


Such an option would make Sublime far more useful at the command-line for one-off file editing. Currently it’s a workflow PITA:


I have Sublime set as my editor for git. Every time I “git commit -a”, Sublime opens with a bunch of tabs (and possibly windows).

Say I write my commit and then close with alt+f4, Git won’t commit because I have another sublime window open and it’s waiting for the process to quit, plus I’ve now broken my window collection from my last development session.

So I have to write my commit, then carefully save it, close the tab and then exit Sublime with File…Exit to keep my windows/projects as they were before. What a faff!

I’ve tried all kinds of workarounds for this, like loading a blank project with the cmdline etc., but none of them play nice. Blank projects have the annoying bug of launching a separate window, and randomly focusing it instead of the window with the file launched from the cmdline.

What we want here is a simple launch option that disables hot_exit, doesn’t load any session/projects, and launches sublime in its own process for one-off editing. This would be dead handy for command line editing, but also for other purposes too, like making sublime the editor launched by other apps.

Sublime is beautiful, but it’s doesn’t play nice for people wanting to launch from the command line for one-off editing. As a result, I usually fall back to vim or whatever for those jobs.

1 Like


Hey guys, I’m posting just because I’m interested in this topic. I have the same issue. I’m looking into projects at the moment. I wonder if a project file could accomplish what we are looking for

1 Like


+1 for me. I’m really confused how there are so many bugs surrounding projects and build systems. (I open a project file with subl Project.sublime-project and instead of opening that project it simply opens it in the currently open or last open project. Prime wtf.) Or, maybe it’s just a misunderstanding but if that’s the case where’s the documentation?

1 Like


You running under tmux? If so, you need to install reattach-to-user-namespace and set an alias like:
alias subl=‘reattach-to-user-namespace /Applications/Sublime\’

–project now works, it will load your project, or file, or whatever. This was frustrating me and I just figured it out a few minutes ago. Then I found this thread about my other gripe. I want the option to not load my previous session (as a command line flag, not as a global config)





I use sublime as my default editor in linux, the fact that version 3 can elevate to root on the fly makes it damn comfy to use
and a switch telling subl to ignore session and just open passed path would be very nice



Still nothing new on this? Would be great with a command line option.



+1 but I guess “technical support” isn’t the right place to post this



+1 This would be really useful, particularly for git commit workflows etc



useful command (running Linux):

subl3 -wn "Enter File Here"

Also add to config:

    "close_windows_when_empty": true

Edit: Add Code Section and Added config fle

1 Like


Step 1 : goto Preferences->settings
Step 2 : Now the setting file is open.Enter following lines
> “hot_exit”: false,

      "remember_open_files": false 

you done it.

1 Like


not sure about the necro, but there is also a request for this functionality here:



Go to Menu Bar > Preference > Settings. One the right hand side add the following two lines,

  "hot_exit": false,
  "remember_open_files": false

Here is a screenshot,

Now, sublime won’t reopen the last session.

1 Like


I apologize for reviving such an old thread, but setting remember_open_files on true also disables saving the files in the recent list. I need to have the files in the recent list but not reopened on the next startup. Is that possible?

Thanks in advance.