davidolrik / sublime-rsync-ssh

Keep remote directories in sync with local projects.
75 stars 33 forks source link

Split remote server answer by '\n' in ssh connection check #20

Closed ivanromanko closed 9 years ago

ivanromanko commented 9 years ago

Sometimes remote server returns more then one line when we check ssh connection: /usr/bin/rsync Killed by signal 1. In this case we should split the answer by '\n' and take first item in list. universal_newlines=True allows us to split by '\n' and split() always produce list, so we are safe even when recieving only path to rsync.

davidolrik commented 9 years ago

I'm guessing you are using a ProxyCommand in your .ssh/config, if so you can suppress the Killed by signal 1 by adding 2> /dev/null to the end of your ProxyCommand.

ivanromanko commented 9 years ago

Wow! You're right, ProxyCommand output redirection works well, thank you!

davidolrik commented 9 years ago

Excellent!