Sublime Forum

Sublime text open twice session and lost data


My current session have 5 windows, in each 5 windows have multiple opened files and not saved files

When i click on txt,html file and open with sublime text, sometime it open the second session, which open another 5 windows

So i’m not realized my unsaved files is in second session instead the first session, so i just choose the 10th windows, file>exit
and it’s not close the whole sublime text, it let first session sublime text there which have 5 windows so i just file>exit, but a new one unsaved file is just gone

is there have any ways to make sublime text automatic create multiple backup session interval ? eg 5mins each, etc…

*I never had this problem in version Sublime text 3,



What version of Sublime Text are you using? We do keep session backups in %APPDATA%\Sublime Text 3\Local alongside the Session.sublime_session file.



build 4166
and yeah i know that session location, but what i want is it automatic create multiple backup session instead only one. Because this Sublime text 4 have something changed which i never meet in Sublime text 3.

So in this case, when i open sublime text, and then open a txt file by double click on it, it open second sublime text session which use the same session profile (i can’t reproduce it, but when it happen, the file i click on is not open right after i double clicked, it just loading in about 10+ seconds, then it open new session with same session profile)

so in this case
if i’m have unsaved tab in second sublime text session, but then i just File>Exit to close that second session, there’s still have first session opened. If i’m File>Exit, session will be re-written which mean any changes(Unsaved tab,etc.) in second session will be gone.

I think you know this problem must not happen,
One session profile - one session sublime text
One session profile - two, three session sublime text



Backups won’t necessarily help in this case. The problem is that two separate instances of ST are writing to the same session file(s), which would still be the case for backups. The real problem here is that two instances are running; that’s inherently problematic for more than just the session. Has this only happened once?



it happened multiple times in the past, i don’t know how to reproduced it and how it happened

usually if a new instances open but with same profile it must have a warning close current instances before new instances open (just like firefox web browser)

I think BackUpTime may help me in this situation, by created multiple copies of ST4 profile each 5-10 mins. But the root and hidden problem still always there in ST4.



oh sorry for late respond, but i think if app is no responding (eg reading 50-500k+ lines, and Alt+F3 for mass-changing, it will be no responding for awhile, if you open any files with sublime text in this time, it will create a second windows on the same instances profile



I can’t reproduce that. Locking up Sublime Text for 60 seconds by running time.sleep(60) in the console and then running subl.exe foo.txt blocks until that time has elapsed and then opens that file. Are you perhaps using sublime_text.exe instead of subl.exe?

1 Like


yes, i pick sublime_text.exe and set it as default to open html files, so that’s the problem ?