瀏覽代碼

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

Taddeus Kroes 1 周之前
父節點
當前提交
f607dda3fa
共有 1 個文件被更改,包括 6 次插入 和 0 次删除
  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
 #