From TextMate Wiki

Troubleshooting: MateFailsWithScreen

There are two problems with screen and the command line `mate` , and of course the solution to one brings out the other :)

  1. Apple screen (`/usr/bin/screen`)

This plain and simple wont work. So use MacPorts screen.

  1. MacPorts screen (`/opt/local/bin/screen` pr default)

This is where it gets complicated. The latest version of MacPorts screen port, which at time of writing is 4.0.3_3 does not work. It fails with

`failed to establish connection with TextMate`

which, incidentally, is the exact same error you get with Apple screen.

It has been established that 4.0.3_1 works ([bug]( https://trac.macports.org/ticket/18235)).

To get that version you need to follow these steps ([source]( http://journal.bitshaker.com/articles/2007/10/20/install-old-versions-of-ports-using-macports/))

  • NB**: Do not uninstall the failing version before proceeding, you need to have 4.0.3_3 installed so you can in fact choose to install 4.0.3_1 at the end
    1. Step 1: Set up a local repository

We edit `/opt/local/etc/macports/sources.conf` and add a line _before_ the last `rsync://` line:

    file:///Users/Shared/dports

The path can be anywhere, really, just make sure the directory exists, and that you can somehow write to it.

  1. Step 2: Check out the correct version of the Portfile for screen 4.0.3_1

Make sure you are standing in the directory you created in Step 1, then do

    $ svn export --revision 45522     http://svn.macports.org/repository/macports/trunk/dports/sysutils/screen/     sysutils/screen/
  1. Step 3: Update the portindex, so you can find the old screen version again

If you are still in the directory you created, run

    $ portindex .
  1. Step 4: Verify that the port got recognized

To check that we now have two ports, we run

    $ port list screen
    screen                         @4.0.3          sysutils/screen
    screen                         @4.0.3          sysutils/screen

The versions are alarmingly similar, but since you didn't remove 4.0.3_3, you can still pick the right one.

  1. Step 5: Compile 4.0.3_1
    $ sudo port install screen @4.0.3_1

This will fail, but in the failing it will tell you what version to deactivate. The fail message will include something like (screen @4.0.3_3+darwin9), which you will need for the next step.

  1. Step 6: Deactivate broken screen 4.0.3_3
    $ sudo port deactivate screen @4.0.3_3+darwin9
  2. Step 7: Activate 4.0.3_1
    $ sudo port activate screen @4.0.3_1

And if all worked out, you should now be able to use `mate` from within screen again :)

Retrieved from http://wiki.macromates.com/Troubleshooting/MateFailsWithScreen
Page last modified on June 15, 2009, at 08:36 UTC