Sublime Forum

What's the deal with launch or new window?

#1

I have the feeling that in the past the -n was just working in exactly the same fashion as --launch-or-new-window.
Now I am on

Sublime Text build 4126

with licence. When I do not have sublime open and I do subl . -n it opens it as it should + empty window.
This is definitely not a desired behaviour that was not present before. If I use --launch-or-new-window it works as it should.

If one use -n when sublime is already running the behaviour is appropriate.

I believe -n should work in a same fashion regardless if sublime is open there or not. When I execute subl . -n I do not care if I have it open in other workspace or not. I just to open it here and in new window.

0 Likes

#2

Your post is quite confusing.

You say

When I do not have sublime open and I do subl . -n it opens it as it should + empty window.
This is definitely not a desired

… but also request the oposite …

believe -n should work in a same fashion regardless if sublime is open there or not.

The second one is current behavior.

0 Likes

#3

Apologies for being confusing. Let me try to explain clearer as this is unfortunately not the case:

Current behaviour

An instance of sublime already running

Executing subl . -n opens new window with current working directory visible in the tree view on the left

Desired output: exactly as it works now, the -n opens current folder in a new window - even if this folder is already open in other running instance of sublime I am getting a “new view” into this folder.

No sublime instance running

Executing subl . -n does open one window as expected but also open a second empty window not related to the current working directory

Desired output: only right window opens.

Comments

I do hope I explained my issue now without the confusion :slight_smile:

0 Likes

#4

If hot_exit: true is set (which is by default), ST always restores the window from the last session (the left window in the screenshot). If -n paramater is given it also opens a new window with the given file/folder.

I just checked behavior with ST3210 on Windows. It behaves exactly the same way as ST4126. If it did not on Linux, it might have been a bug. Command line interface received some updates to improve consistency of behaviors across platforms.

0 Likes