Sublime Forum

-n command line switch does not work if no tabs are open

#1

This happens when a Sublime window is open but no tabs are open. The command-line switch -n should open up a new window, but it simply focuses the already-open window.

There are instances when I have a Sublime project open but no tabs open and I want to keep that window open, and open up a new Sublime project. I have “subl -n” bound to a keyboard shortcut to open up a new Sublime instance. What should happen: a new Sublime window opens up on the current workspace. Instead, nothing happens, since a Sublime window is already open. So the command line switch -n is not doing anything.

0 Likes

#2

Which OS?

Works on Windows with ST3176.

0 Likes

#3

Linux (Manjaro i3), 3176.

0 Likes

#4

Works on Debian 9 the same way as on Windows.

subl -n focuses an already open empty Window (no tabs, no project open)

As soon as one tab is open or folders are present in the sidebar subl -n creates a new window. If folders are present a new window is opened even if no tabs are open.

Why adding a keybinding to subl -n? If you have an instance open, you can simply press ctrl+shift+N to open a new window. No need to run subl -n.

0 Likes

#5

Often I’m on a different workspace from where Sublime is already open, and I want to open a new Sublime window in my current workspace. Having a subl -n shortcut guarantees that a fresh window will open regardless whatever workspace I’m on, rather than having to switch to the workspace with Sublime and hitting ctrl+shift+N and switching back to that workspace.

0 Likes