9

I often have several virtual desktops open in Windows 10 with various programs in each one. I often want to open in my current virtual desktop a new instance of a program that already has a window open in another virtual desktop.

Most programs, like Chrome and Microsoft Word, always open a new window on the current desktop when I start them, even if there's already another window of that program on another desktop. However, attempting to start Sublime Text will cause Windows to switch to the virtual desktop in which the program is already running*, instead of opening a new window on my current one. This behavior occurs with Sublime Text 2 and 3.

Is there any way to force Sublime Text to always open a new window even if it's already running somewhere?

(*The issue isn't specifically to do with multiple desktops -- it can also be demonstrated on a single desktop. When most programs open a new window on starting even if they're already running on that desktop, Sublime Text will bring one of its existing windows into focus.)

4 Answers 4

7

You can make Sublime Text 4 behave like other programs by disabling "remember_workspace" setting.

Go to Preferences -> Settings, which will open default settings in a left panel and customized settings in the right panel. Add "remember_workspace": false to the JSON file in the right panel. Sublime Text behaves normally now.

1
  • Thank you! This is the correct answer for Sublime Text 4. This was the only irritation I had with ST4. I can now go back to enjoying it. Commented Dec 29, 2022 at 22:52
5

The simple solution as pointed out by r-stein in the comments to this answer is just to use the command line argument -n. You can manually edit Sublime's Start menu shortcut to include this. If you want to pin Sublime to the taskbar, just drag the edited shortcut there for the same behavior.

This doesn't affect Sublime's behavior when you double-click a file to open it in Sublime; it will still open in an existing Sublime window if there is one. To overcome this, you can edit the registry key HKEY_CLASSES_ROOT\Applications\sublime_text.exe\shell\open\command to add -n between the path to Sublime's executable and "%1".

2
  • 1
    A new instance is different to a new window. I am not familar with win10, but pressing windows+r should popup an execute window. If you paste in that window C:\Program Files\Sublime Text 3\subl.exe -n (obviously with your path to ST) it should open a new ST window. From that command one could create something like nicer opening menu item.
    – r-stein
    Commented Mar 29, 2016 at 20:21
  • 1
    Ah, the -n argument was exactly what I was looking for, thanks!
    – erobertc
    Commented Mar 29, 2016 at 20:26
0

SHIFT + CLICK on the Sublime task bar icon. This usually opens Sublime in a new window automatically and does not go to other desktops.

If I am using an FTP program, I've made it a habit to SHIFT + Click on the ST Task bar icon first before opening file from FTP.

Get's the Job done.

-1

HKEY_CLASSES_ROOT\Applications\sublime_text.exe\shell\open\command

change to value

"C:\Program Files\Sublime Text 3\sublime_text.exe" -n "%1"

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .