]> git.friedersdorff.com Git - max/dotfiles.git/commitdiff
ssh_in launches terminal, sshes into machine
authorMaximilian Friedersdorff <max@friedersdorff.com>
Thu, 13 Sep 2018 08:37:10 +0000 (09:37 +0100)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Thu, 13 Sep 2018 08:37:10 +0000 (09:37 +0100)
Will also launch tmux on remote machine, or attach to the
session if it exists already

bash/.bash_aliases

index de525676956ecfc4d5228ad5efc22f06add7a1de..952029c6af8df02214836da349205b8f7d54534f 100644 (file)
@@ -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 "$@"
+}