Mark Fowler 4 years ago • updated by Tom B 2 years ago 5
Passing a filename to the "subl" command line tool when no Sublime Text 2 window is open causes a new window to open with "Untitled" to appear, but the filename isn't opened. 

sometimes i dont even get my folter oppened on project panel... and i have to do the subl command again and again ultil it opens the project panel


This has bothered me for a long time. It can be seen in both ST2 and ST3.

It is rather inconsistent, sometimes it works, often it doesn't. I also have had to re-run the command up to 5 times or so before the requested file or folder would finally open.

Yep, they still didn't fix this for ST3. Nerve wrecking because it's totally random.

I use AppleScript (OS X) to open a project file and my workaround was to first activate ST, wait 2 seconds (I found it was the minimum for ST to be "ready") and then open the project.


do shell script "'/usr/local/bin/subl' '~/Documents/Sublime Text/project.sublime-project'"

tell application "Sublime Text" to activate
delay 2
do shell script "'/usr/local/bin/subl' '~/Documents/Sublime Text/project.sublime-project'"


Well i think its a memory problem... when i run to much programs on my pc the chance of this happens is to much big than when i start my computer

Based on the suggestion by Damazio above, for me it worked to put this in my .bash_profile:

alias edit='subl && sleep 0.1 && subl'
I'm on a fast MacBook Air so for me 0.1 seconds of sleep already do the trick... other users may have to increase the value.