Sublime Forum

Opening X.sublime-project also opens prior project. How prevent?

#1

When I click on an X.sublime-project file it opens the relevant project, but it also opens the prior project in a separate window that I must then close before proceeding to work on the project in which I’m interested. This is a minor nuisance, but as it sometimes bites me multiple times a day it gets tiresome.

Is there a way to prevent this annoying behavior?

Platform: Windows 10, ST3 Build 3211

0 Likes

#2

That’s a side effect of the hot_exit machinery, which always restores the last session with all its windows and open projects.

I’d also prefer to persist the unsaved files of a window in the workspace instead of the global session somehow to be able to start a clean window by opening a project.

The only way to prevent the old session from opening is to set hot_exit: false in the preferences, but this will cause ST to save all files uppon exit all the time.

0 Likes

#3

Maybe I’m not understanding something, but wouldn’t you want ST to save all files upon exit by default? Surely you wouldn’t want to lose your work upon exiting.

0 Likes

#4

They’re not lost they’re saved in a temporary file on quit then restored to the edit buffer when you return.

0 Likes

#5

Something to note is that the hot_exit mechanism makes Sublime restore its state to what it was in at the point where you quit it, which will make it restore every window that was open at the time.

So, if you don’t want to restore previous projects you could close the window before you quit Sublime. In fact, on Windows and Linux closing the last Sublime window will quit Sublime as well. On MacOS Sublime will keep running in the background even if it has no windows.

All else being equal, if you get in the habit of closing windows when you’re done with them, things should work out for you.

0 Likes