浏览代码

fix(ssh-agent): use termux prefix for tmp (#12695)

flyingpeakock 2 月之前
父节点
当前提交
2a2f8ecb67
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      plugins/ssh-agent/ssh-agent.plugin.zsh

+ 5 - 1
plugins/ssh-agent/ssh-agent.plugin.zsh

@@ -100,7 +100,11 @@ function _add_identities() {
 if zstyle -t :omz:plugins:ssh-agent agent-forwarding \
    && [[ -n "$SSH_AUTH_SOCK" ]]; then
   if [[ ! -L "$SSH_AUTH_SOCK" ]]; then
-    ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USERNAME-screen
+    if [[ -n "$TERMUX_VERSION" ]]; then
+      ln -sf "$SSH_AUTH_SOCK" "$PREFIX"/tmp/ssh-agent-$USERNAME-screen
+    else
+      ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USERNAME-screen
+    fi
   fi
 else
   _start_agent