Browse Source

Add moshx alias for ssh *x hosts, since mosh does not support RemoteCommand

Taddeus Kroes 1 week ago
parent
commit
f607dda3fa
1 changed files with 6 additions and 0 deletions
  1. 6 0
      bashrc

+ 6 - 0
bashrc

@@ -140,6 +140,12 @@ pless() {
     pcat "$@" | less -r
 }
 
+moshx() {
+    local host="$1"
+    local session="${2:-default}"
+    mosh -- "$host" sh -c "tmux attach -t '$session' || exec tmux new -s '$session'"
+}
+
 #
 # Environment
 #