aurora / rmate

Remote TextMate 2 implemented as shell script
GNU General Public License v3.0
886 stars 123 forks source link

doesn't work on remote mac if Textmate installed & opened on the remote mac #75

Open benpptung opened 4 years ago

benpptung commented 4 years ago

I have been using rmate in all my remote servers. Recently, I've just bought another mac laptop, so I hope I can use rmate on it too.

However, it's interesting if the TextMate is opened on the remote mac, the rmate command will open the TextMate on the remote mac. I have to quit TextMate on the remote mac, so rmate will open the file locally.

I'm wondering if anything I can do to fix this? Thank you :)

aurora commented 4 years ago

I am not sure if i understand your problem properly:

You are using a MacBook and want to open TextMate locally using rmate rather than opening the file on a remote Mac? Where is rmate located in this case - on your local Mac or on the remote Mac?

benpptung commented 4 years ago

Sorry for misunderstanding. That said, I have 2 mac computers A and B.

Using mac remote login, I can login B from A, and I hope to use rmate to open TextMate locally in A. The rmate is installed in B under ~/bin already.

In B, if TextMate is installed and opened, the rmate will open the file in B using TextMate. If I quit B's TextMate, rmate will work as expected, and open the file in A using A's TextMate.

aurora commented 4 years ago

Thanks for clarification! I have to admit, that i never tested this case, will do so.

tiktuk commented 4 years ago

Me and my colleague had the same problem. Worked around it using aliases to rmate which different port numbers.

aurora commented 4 years ago

Sorry, will take a little longer to fix, because i am currently very busy with other things. I hope will be able to get back to this mid Novembre.

randy3k commented 4 years ago

I use this to change port number

.bashrc file on server

if ([[ -n "$SSH_CLIENT" ]] || [[ -n "$SSH_TTY" ]]); then
    export RMATE_PORT=52658
fi

.ssh/config in local

Host example.com
    RemoteForward 52658 localhost:52698
    User user
SuperSandro2000 commented 4 years ago
if [[ -n $SSH_CLIENT || -n $SSH_TTY ]]; then
    export RMATE_PORT=52658
fi

or shorter