Hello there,
I have a problem with my portable version of Sublime Text 4: I would like the program to use only one instance so that whenever I open a document (via double click, from the command line / via autohotkey script etc.) it is opened as a new tab in the already existing Sublime Text window. This worked in ST3, however since I updated to ST4 it does not work any more. If I open new (existing) files e. g. via double click or by a command from an auto hotkey script, a new Sublime Text instance / window is opened with the tabs that were already open plus the new tab.
In the default preferences file ( the setting for “open_files_in_new_window” is set to “never”. I have also tried adding the setting " “open_files_in_new_window”: false " to the user preference file, to no avail.
How can I force the portable version of Sublime Text 4 to only use one instance under any conditions?
Many thanks in advance, Holger
ST4 (Portable) problem: Single instance does not work
Do you run subl.exe
or sublime_text.exe
? I’ve bound everything to the latter one and don’t see any new instances or windows being created. Using portable setup as well.
Works with double clicking associated files and by using context menu, which I added ST to with following registry entries.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\sublime_text]
@="Ă–ffnen mit Sublime Text"
"Icon"="\"C:\\Apps\\Sublime Text\\sublime_text.exe\",0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\sublime_text\command]
@="C:\\Apps\\Sublime Text\\sublime_text.exe \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\sublime_text]
@="Ă–ffnen mit Sublime Text"
"Icon"="\"C:\\Apps\\Sublime Text\\sublime_text.exe\",0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\sublime_text\command]
@="C:\\Apps\\Sublime Text\\sublime_text.exe \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.sublime-build]
@="sublime_text"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.sublime-commands]
@="sublime_text"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.sublime-color-scheme]
@="sublime_text"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.sublime-completions]
@="sublime_text"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.sublime-keymap]
@="sublime_text"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.sublime-macro]
@="sublime_text"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.sublime-menu]
@="sublime_text"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.sublime-mousemap]
@="sublime_text"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.sublime-project]
@="sublime_text"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.sublime-settings]
@="sublime_text"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.sublime-snippets]
@="sublime_text"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.sublime-syntax]
@="sublime_text"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.sublime-theme]
@="sublime_text"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.tmTheme]
@="sublime_text"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.tmPreferences]
@="sublime_text"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\sublime_text]
@="Sublime Text File"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\sublime_text\DefaultIcon]
@="\"C:\\Apps\\Sublime Text\\sublime_text.exe\",1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\sublime_text\shell\open\command]
@="\"C:\\Apps\\Sublime Text\\sublime_text.exe\" \"%1\""
Thank you very much for your answer and for sharing your registry settings, deathaxe!
Indeed I have also bound my text files of all sorts (txt, ini, markdown etc.) to sublime:text.exe in the registry settings via a regfile, but it is good to know that in principle forcing a single instance of Sublime Text 4 Portable should work as it did with Sublime Text 3. I guess I will have to continue digging into the problem some more to hopefully finally figure out what is the problem on my machine – so far I have no idea.
Cheers,
Holger
The same here, using Sublime Text 4 on Windows 10 machine, and it’s very annoying to have multiple instances of ST, Notepad++ handled this ideally, i’m sad(