Sublime Forum

Hot_exit setting not working

#1

I’ve written a script that I use to initialize my development space whenever I log into my computer. One thing that it opens is sublime using the following command:

$> subl3 /path/to/my/project

The problem I’m having is that whenever the script runs it opens sublime 3 for my project but then also opens the project(s) from the last session as well. Ex: After rebooting my computer and the script running 5 times, I have 5 separate windows for the same project open.

I set the following setting in my user preferences:

"hot_exit": false

but this doesn’t seem to work and my old sessions continue to open. It seems to work if I manually close sublime before logging out but I often just logout/shutdown without closing each individual window that I’m using.

Am I missing something?

0 Likes

#3

As part of your start up script, try deleting this:

rm ~/Library/"Application Support"/"Sublime Text 3"/Local/Session.sublime_session

or if you’re on linux:

rm ~/.config/sublime-text-3/Local/Session.sublime_session

before you start up sublime.

I wish there was a subl --data-path

1 Like

#4

As a workaround, you can invoke subl with a custom HOME environment variable, which seems to be enough to make it prompt for a licence (dev channel). I intended to use this for “portable” setups but never actually tried it before 10s ago.

$ HOME=/tmp subl
1 Like

#5

On Linux, the most specific env var to use would be XDG_CONFIG_HOME which sets the path to the .config/ path to use. A folder named sublime-text-3/ will be created under the dir specified in that var.

3 Likes

#6

This worked, thanks a lot!

I also had to remove the auto save session:

rm ~/.config/sublime-text-3/Local/Session.sublime_session ~/.config/sublime-text-3/Local/'Auto Save Session.sublime_session'
1 Like