Thanks, William. This is the first real packaged solution that solves this problem for me. I made a few modifications though. Namely, my net connection typically doesn't allow direct SSH connections to my laptop, so instead of the remote 'mate' command issuing a ssh session directly, I have it running through a tunnel.
So when I connect to a remote server, I add a '-R' switch, like so:
-R 7777/localhost/22
For example:
ssh -R 7777/localhost/22 user@remotehost.com
(You can use some other port besides 7777, and obviously, this requires ssh to be running on your local mac.)
Once you connect, it's possible to ssh back to your local machine over localhost:7777.
Then, the 'mate' command I use on the remote server uses the tunnel instead:
#!/bin/sh
# Replace this with the port you're using for tunneling back tunnelPort=7777
remoteUser=willu
if echo $1 | egrep ^/ - > /dev/null ; then path=$1 ; else path=`pwd`/$1 ; fi
HOST=`hostname`
echo Opening $path as ${remoteUser} to ${SSH_CLIENT%% *}
ssh ${remoteUser}@localhost -p ${tunnelPort} remoteOpen ${USER} $ {HOST} "$path" < /dev/null
On Oct 21, 2006, at 4:33 AM, William Uther wrote:
Hi all,
I just finished some scripts that allow remote editing with TextMate, kinda like BBedit's sftp functionality. They're a little rough, but I thought I'd release them so that others can play if they want.
http://www.cse.unsw.edu.au/~willu/RemoteEdit/
Cheers,
Will :-}
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate