Sublime Forum

Save and restore session (ST4)

#1

How can I save and restore my current session, down to open windows, layout of each window, open files, unsaved files, cursors, bookmarks, and everything else that gets restored on opening Sublime Text?

Basically I want to pause my session, stash everything, hack on something else, and then come back to the exact state I was in. Is this possible to do?

Thanks!

0 Likes

#2

The thing that controls this is the hot_exit setting, which is enabled by default and which does all of this out of the box in a global sense. That is, by default you can exit Sublime and restart it and get back to exactly where you were.

If you’re on MacOS, it may be worth pointing out that closing windows and quitting the application aren’t the same thing; to get this to work you need to actually quit Sublime.

On a window by window basis you can do this by using projects in Sublime; the state of windows that have a project open in them are persisted in workspace files specific to the project, while the application state as a whole goes into an overall session file.

So by default quitting Sublime will allow you to restore back to where you were last on restart, but if you want to close a window and then recall it’s contents later (without quitting Sublime in the interim) use projects.

0 Likes