Skip to content

Commit

Permalink
fix(tailscale): load completion when tailscale is an alias (ohmyzsh…
Browse files Browse the repository at this point in the history
…#12726)

This makes it work when Tailscale is installed via App Store:
https://tailscale.com/kb/1080/cli?tab=macos.

Co-authored-by: Marc Cornellà <[email protected]>
  • Loading branch information
Hyffer and mcornella authored Nov 19, 2024
1 parent 081d704 commit e636eeb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugins/tailscale/tailscale.plugin.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if (( ! $+commands[tailscale] )); then
if (( ! $+commands[tailscale] && ! $+aliases[tailscale] )); then
return
fi

Expand All @@ -7,7 +7,12 @@ fi
if [[ ! -f "$ZSH_CACHE_DIR/completions/_tailscale" ]]; then
typeset -g -A _comps
autoload -Uz _tailscale
_comps[tailscale]=_tailscale

if (( $+commands[tailscale] )); then
_comps[tailscale]=_tailscale
elif (( $+aliases[tailscale] )); then
_comps[${aliases[tailscale]:t}]=_tailscale
fi
fi

tailscale completion zsh >| "$ZSH_CACHE_DIR/completions/_tailscale" &|

0 comments on commit e636eeb

Please sign in to comment.