Browse Source

chore: tmux.conf 丰富 bash 路径回退策略

dzp 2 years ago
parent
commit
a4cdd0c798
1 changed files with 10 additions and 2 deletions
  1. 10 2
      tmux.conf

+ 10 - 2
tmux.conf

@@ -12,13 +12,21 @@ set -g buffer-limit 20000;
 # 快捷键采用 vi 模式
 setw -g mode-keys vi
 
-# 设置默认 Shell 为 bash,Termux 上的路径比较特殊,单独处理一下
+# 设置默认 Shell 为 bash,但各平台路径各异,需要分别特殊处理
 if-shell 'test -x /data/data/com.termux/files/usr/bin/bash' {
     set -g default-shell /data/data/com.termux/files/usr/bin/bash
     bind-key -n Home send Escape "OH"
     bind-key -n End  send Escape "OF"
 } {
-    set -g default-shell /bin/bash
+    if-shell 'test -x /usr/local/bin/bash' {
+        set -g default-shell /usr/local/bin/bash
+    } {
+        if-shell 'test -x /usr/bin/bash' {
+            set -g default-shell /usr/bin/bash
+        } {
+            set -g default-shell /bin/bash
+        }
+    }
 }
 # }}}