Skip to content

Instantly share code, notes, and snippets.

@FiXato
Last active December 11, 2015 04:49
Show Gist options
  • Save FiXato/4548240 to your computer and use it in GitHub Desktop.
Save FiXato/4548240 to your computer and use it in GitHub Desktop.
# 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