Sublime Forum

Subl command broken in 2175? (OSX)

#1

I am trying to open some files via the commandline and a new sublime text window shows up but doesn’t actually open any of my files. I am getting messages like this on open:

2/8/12 4:26:00.465 PM Sublime Text 2: *** -[NSMachPort handlePortMessage:]: dropping incoming DO message because the connection is invalid

I’m going to try reverting to 2174 and see what happens.

0 Likes

The “subl <some file>” command gives me a blank window
ST3 sometimes not opening files / folders from command line
#2

Actually, it looks like it doesn’t work when there are no windowsopen – if I have an editor window up then everything works fine. Weird!

0 Likes

#3

Works fine here. With sublime closed, I can type subl .bash_profile and it launches and opens it.

0 Likes

#4

I’m having the exact same problem as masterjeef.

The “dropping incoming DO message” error is logged in the OS X Console and the “subl” command opens an empty window unless I already have an editor window open.

I am using build 2181.

0 Likes

#5

How are you using this command?

If ST2 is not running and I type “subl”, ST2 launches and an empty window opens (the normal default launch behavior);

If I type “subl myFile.html” (when in a directory with such a file) it opens for editing.

I assume this is the way its supposed to work.

0 Likes

#6

[quote=“handycam”]How are you using this command?

If ST2 is not running and I type “subl”, ST2 launches and an empty window opens (the normal default launch behavior);

If I type “subl myFile.html” (when in a directory with such a file) it opens for editing.

I assume this is the way its supposed to work.[/quote]

You are correct: that is how it is supposed to work. I wish it still worked for me.

Here is how I am using this command:

~$ subl .bash_profile

(Should open my bash profile)
Result: Blank “untitled” window.

Also:

~$ cd myproject
~/myproject$ subl .

(Should open the current directory as a project in ST2)
Result: Blank “untitled” window.

Each time this happens, a message like the following is logged:

2/24/12 1:12:09.002 PM Sublime Text 2: *** -[NSMachPort handlePortMessage:]: dropping incoming DO message because the connection is invalid

Note that everything works correctly if I already have an ST2 window open. But of course, I would like it to work all the time.

Scenarios:

  • App is not running. Type “subl ”. Result: blank “untitled” window

  • App is running but no windows are open. Type “subl ”. Result: blank “untitled” window

  • App is running and at least one window is open. Type “subl ”. Result: success

Things I have tried:

  • restarting

  • rm’ing and re-creating my “~/bin/subl” symlink.

  • deleting my “~/Library/Application Support/Sublime Text 2” folder (i.e., stock configuration)

I am using Lion 10.7.3 and ST 2 build 2181.

0 Likes

#7

That really stinks. I have no clue.

0 Likes

#8

I just created a link:

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

It works but creating a PATH in bashrc would be the “proper solution”.

0 Likes

#9

[quote=“kd7swh”]I just created a link:

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

It works but creating a PATH in bashrc would be the “proper solution”.[/quote]

Yes, that is similar to what I did, as per the documentation.

Please read above for a description of the problem—it’s a bug in 2181, not a mis-understanding on my part or masterjeef of how to create or use the “subl” command.

0 Likes

#10

I’m experiencing the same issue in 2181:

This command:

subl .

opens ST2 with no folders/files open (blank). However, one workaround that only requires slightly more typing is:

subl -a . 

That works for me.

Edited to add: whoops, spoke too soon. This only works if you have an instance of ST2 already running. If none are running, this also does not work.

0 Likes

Command line parameter causes two windows to open
#11

I had the same issue issue for months, but subl -a resolves it for me. To save on the extra typing, I added this to my ~/.bash_profile, then use sub instead of subl:

alias sub="subl -a"
0 Likes

#12

Hi,

I know this is an old post, but this problem cropped up again for me with ST3. The workaround which seems to work for me is:

alias s='subl && subl'

So when I use the command

s filename.c

It essentially executes subl twice: first to start sublime, if it isn’t already running and second bring up filename.c in the editor.

Works for me, YMMV,

Matt

0 Likes

#13

You might want to also look at this Stackoverflow posting which has some related information: stackoverflow.com/a/14636165/12711

0 Likes