Sublime Text 2: subl shell command often fails to open files Sublime Text 2: subl shell command often fails to open files shell shell

Sublime Text 2: subl shell command often fails to open files


Had the same problem for a while now. Add the following line to your .bash_profile:

alias subl='subl && sleep 0.1 && subl'

Now you can use subl filename_to_edit to open it.

If you are not sure if you configured subl command correctly, do the following. Run the first command for ST3 or the second for ST2:

ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/sublln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl

Make sure that ~/bin is in your $PATH. Then do the first step with .bash_profile.

Finally works as it should! Credit goes to these guys and chrisf for improvement.


I remember running into problems with subl before. And had to come up with a function to see if Sublime is running, if not launch it, see if it loaded. Then use "rmate" bash script and the associated "rsub" Sublime Text Package plugin to load in the specified file. However you should be able to use the OSX open command should work for what you need. I would also give the latest Sublime Text 3 Beta a try.