Skip to content

Instantly share code, notes, and snippets.

@jmervine
Created September 2, 2015 22:40
Show Gist options
  • Save jmervine/1890befd38ad32c420c0 to your computer and use it in GitHub Desktop.
Save jmervine/1890befd38ad32c420c0 to your computer and use it in GitHub Desktop.
tmate helper wrapper
# tmate
function tmate {
local _sock=/tmp/tmate.sock
local _tmate=/usr/local/bin/tmate
if [ -z "$@" ]; then
$_tmate -S $_sock
else
case $@ in
p|print|ssh|url)
$_tmate -S $_sock display -p '#{tmate_ssh}';;
ro|printro|sshro|rourl|urlro|rossh)
$_tmate -S $_sock display -p '#{tmate_ssh_ro}';;
*)
$_tmate $@
esac
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment