There are two problems with screen and the command line `mate` , and of course the solution to one brings out the other :)
This plain and simple wont work. So use MacPorts screen.
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/))
We edit `/opt/local/etc/macports/sources.conf` and add a line _before_ the last `rsync://` line:
The path can be anywhere, really, just make sure the directory exists, and that you can somehow write to it.
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/
If you are still in the directory you created, run
$ portindex .
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.
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.
And if all worked out, you should now be able to use `mate` from within screen again :)