Sublime Forum

Opening a project from command line

#1

Doing subl --project registers the project. So if the project isn’t already open it’ll open it in a new window, otherwise it opens up a new empty project, very odd behavior.

Opening the sublime-project file just pops it into the editor.

I’m looking for a good way to hop straight into a project from a macro or something similar.

1 Like

#2

Could you explain what you’re trying to do in more detail? The described behaviour sounds correct to me.

0 Likes

#3

current behavior:

If the project isn’t open:
$ subl --project foo.sublime-project :arrow_right: open foo project in new window

If the project is open:
$ subl --project foo.sublime-project :arrow_right: open empty window

desired behavior for unopened project:
$ subl --project foo.sublime-project :arrow_right: open foo project in main window and focus on app
$ subl -n --project foo.sublime-project :arrow_right: open foo project in new window and focus on said window

desired behavior for opened project:
$ subl --project foo.sublime-project :arrow_right: focus on window with foo project opened
$ subl -n --project foo.sublime-project :arrow_right: focus on window with foo project opened

1 Like