TextMate on Leopard Command Line Tool Fix

Text MateI 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.

Tags: , , , , , ,  

No Comments

  1. Brilliant, thank you!

  2. 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…

  3. 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

  4. Nate Hatcher

    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

  5. 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

  6. 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
    )
    

  7. alias mate=’open -a TextMate.app’ worked great for me on a clean install of Leopard

  8. nice!
    Thanks!

  9. Guðmundur Hreiðarsson

    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!

Leave a comment

You must be logged in to post a comment.