From: Maximilian Friedersdorff Date: Thu, 13 Sep 2018 08:37:10 +0000 (+0100) Subject: ssh_in launches terminal, sshes into machine X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=931f09be7e7d09db5c26616096d285e9964b6c5e;p=max%2Fdotfiles.git ssh_in launches terminal, sshes into machine Will also launch tmux on remote machine, or attach to the session if it exists already --- diff --git a/bash/.bash_aliases b/bash/.bash_aliases index de52567..952029c 100644 --- a/bash/.bash_aliases +++ b/bash/.bash_aliases @@ -24,3 +24,10 @@ alias tmux='TERM=xterm-256color tmux' if [ -x /usr/bin/gvim ]; then alias vim='gvim -v' fi + + +function ssh_in() { + i3-sensible-terminal -e \ + ssh -o RemoteCommand="/bin/sh -c 'tmux has-session && exec tmux attach || exec tmux'" \ + -t "$@" +}