From 931f09be7e7d09db5c26616096d285e9964b6c5e Mon Sep 17 00:00:00 2001 From: Maximilian Friedersdorff Date: Thu, 13 Sep 2018 09:37:10 +0100 Subject: [PATCH] ssh_in launches terminal, sshes into machine Will also launch tmux on remote machine, or attach to the session if it exists already --- bash/.bash_aliases | 7 +++++++ 1 file changed, 7 insertions(+) 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 "$@" +} -- 2.46.2