56afe7b3685be8a1ddef25a742016dc76c0a5f8f
- Author
- MoetaYuko <loli@yuko.moe>
- Committer
- GitHub <noreply@github.com>
- Date
Message
fix(tmux): add completion for alias functions (#12468)
Diff
1diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh
2index f655983581697f2c0c1ab5ec8fad9673fdbf1e09..399de1cccd451a4a04e69ac0664540d739207287 100644
3--- a/plugins/tmux/tmux.plugin.zsh
4+++ b/plugins/tmux/tmux.plugin.zsh
5@@ -57,6 +57,19 @@ function _build_tmux_alias {
6 tmux $2 $3 \"\$@\"
7 fi
8 }"
9+
10+ local f s
11+ f="_omz_tmux_alias_${1}"
12+ s=(${(z)2})
13+
14+ eval "function ${f}() {
15+ shift words;
16+ words=(tmux ${@:2} \$words);
17+ ((CURRENT+=${#s[@]}+1))
18+ _tmux
19+ }"
20+
21+ compdef "$f" "$1"
22 }
23
24 alias tksv='tmux kill-server'