TextMate on Leopard Command Line Tool Fix
Posted in Leopard, Shell on 11/01/2007 01:36 pm by jmccune
I quickly noticed that the “mate” command line tool does not work as expected under GNU Screen on Leopard. The error I get is:
mate: failed to establish connection with TextMate.
I suspect this is a side-effect of the Leopard sandbox feature. I’ve found a quick shell alias to be a nice work-around:
alias mate='open -a TextMate.app'
This works inside of GNU Screen, where the mate command line utility does not.
11/19/2007 at 6:58 am
Brilliant, thank you!
11/28/2007 at 10:17 pm
This isn’t such a great fix. Remove the alias, then open up textmate go to Help -> Terminal Usage. See if that doesn’t fix it better…
12/10/2007 at 10:21 am
Tim Case,
I wrote this article because the “Terminal Usage” command doesn’t work properly in Leopard. The new security sandboxing prevents the “mate” command from communicating with TextMate.
The alias is a simple and robust solution. Why don’t you think it’s such a great fix? Admittedly, you lose the ability to wait for TextMate, with mate -w, if you’re doing a revision controlled commit or something…
Cheers,
Jeff
12/13/2007 at 3:31 pm
Hi Jeff,
The TextMate command line tool works fine for me on Leopard (10.5.1) if I tell TM to put the link in /bin. It didn’t work when I had TM put the link in /usr/local/bin.
All the best,
Nate
01/23/2008 at 6:54 pm
Nate,
Thank you for the information. Unfortunately, I run TextMate out of /Users/mccune/Applications/TextMate.app which is a file vault protected home folder.
Creating a symbolic link into /bin wouldn’t work for other users, but I’ll consider installing TextMate.app into the system wide /Applications folder to get everything working.
Ideally, I’d be able to have a link in ~/bin/mate point to ~/Applications/TextMate.app/Contents/Resources/mate
01/23/2008 at 6:59 pm
Nate,
Also, no matter what I do, I get errors running mate. even from /bin
% /bin/mate exclude 2008-01-23 18:58:26.224 mate[16002:10b] An uncaught exception was raised 2008-01-23 18:58:26.225 mate[16002:10b] *** -[NSCFArray objectAtIndex:]: index (-1( or possibly larger)) beyond bounds (0) 2008-01-23 18:58:26.226 mate[16002:10b] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (-1( or possibly larger)) beyond bounds (0)' 2008-01-23 18:58:26.227 mate[16002:10b] Stack: ( 2507817579, 2416955547, 2507817035, 2507817098, 2526203359, 2525670584, 9955, 14255, 9754, 9525 )03/14/2008 at 4:26 pm
alias mate=’open -a TextMate.app’ worked great for me on a clean install of Leopard
08/21/2008 at 4:04 pm
nice!
Thanks!
09/09/2008 at 3:02 am
Great - thanks! I ran into this problem when trying to invoke TM through a SSH tunnel to Tiger, so this apparently isn’t only causing problems on Leopard. But your method does the trick!