Browse Source

fix(tmux): add completion for alias functions (#12468)

MoetaYuko 10 months ago
parent
commit
56afe7b368
1 changed files with 13 additions and 0 deletions
  1. 13 0
      plugins/tmux/tmux.plugin.zsh

+ 13 - 0
plugins/tmux/tmux.plugin.zsh

@@ -57,6 +57,19 @@ function _build_tmux_alias {
       tmux $2 $3 \"\$@\"
     fi
   }"
+
+  local f s
+  f="_omz_tmux_alias_${1}"
+  s=(${(z)2})
+
+  eval "function ${f}() {
+    shift words;
+    words=(tmux ${@:2} \$words);
+    ((CURRENT+=${#s[@]}+1))
+    _tmux
+  }"
+
+  compdef "$f" "$1"
 }
 
 alias tksv='tmux kill-server'