浏览代码

fix(tailscale): fix completion binding for alias to `Tailscale` (#12928)

Fixes #12928
Marc Cornellà 2 月之前
父节点
当前提交
501f29f90c
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      plugins/tailscale/tailscale.plugin.zsh

+ 7 - 0
plugins/tailscale/tailscale.plugin.zsh

@@ -15,4 +15,11 @@ if [[ ! -f "$ZSH_CACHE_DIR/completions/_tailscale" ]]; then
   fi
 fi
 
+# If using the alias, let's make sure that the aliased executable is also bound
+# in case the alias points to "Tailscale" instead of "tailscale".
+# See https://github.com/ohmyzsh/ohmyzsh/discussions/12928
+if (( $+aliases[tailscale] )); then
+  _comps[${aliases[tailscale]:t}]=_tailscale
+fi
+
 tailscale completion zsh >| "$ZSH_CACHE_DIR/completions/_tailscale" &|