This is a bug in Sublime Text 2. Sublime remembers the last session and files that were opened after you exit the program by default. In some cases that is a good feature but for me and it seems as you as well it is not.
So what happens is when you create the symbolic link so you can type "subl" in the terminal window Sublime Text 2 will open the last session. If you type "subl ." it will open two windows the last session, and the current folder hierarchy in another window.
So what happened to me is I cd
into a new Rails project folder and wanted to open just the current project folder in Sublime Text 2 and it was not happening.
So my work around was:
Disable auto load sessions/last file(s): Open sublime text 2 and Go to, Preferences/Settings-User.
Add these two lines: (if curly braces are present just add a comma to the end of last item in the list and the enter text into existing braces. If no items keep curly braces)
{
//disable auto-load sessions and files feature
"hot_exit": false,
"remember_open_files": false
}
Open a terminal window and cd into whatever directory you want and enter "subl . &" this will keep the terminal window activate so you can still type commands that are associated with the project (ie running rspec test from inside sublime text 2 for current project) and open all the files in the current folder hierarchy. You can now open and save files but will not have to exit sublime text 2 to use terminal.
Warning! If you exit the terminal window after opening sublime text 2 in this fashion, the sublime text window will close as well along with all the tabs you have open. If needs to close this terminal window instance for some reason and keep all your files open to keep working click into the terminal window instance and press Ctrl+Z'.
That's my work around for my current situation, maybe it my work for your situation or someone else's.
/opt/SublimeText2/sublime_text my-project
?nohup
and the&