Last active
December 11, 2015 04:49
-
-
Save FiXato/4548240 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mousemode alias so the mouse works in WeeChat while running mosh: | |
alias mousemode="perl -E ' print \"\e[?1005h\e[?1002h\" '" | |
# Command function to enable mousemode, get the mosh key and port, lookup the ip for the hostname and set up the mosh-client connection | |
function mosher() { | |
mousemode | |
mosh_string=$(ssh $1 -t mosh-server|grep "MOSH CONNECT") | |
mosh_key=$(echo $mosh_string|cut -d " " -f4) | |
mosh_port=$(echo $mosh_string|cut -d " " -f3) | |
mosh_ip=$(ping -n 1 $1 | grep Pinging | cut -d '[' -f 2|cut -d ']' -f 1) | |
MOSH_KEY=$(echo $mosh_key) mosh-client $(echo $mosh_ip) $(echo $mosh_port) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment