From 56afe7b3685be8a1ddef25a742016dc76c0a5f8f Mon Sep 17 00:00:00 2001 From: MoetaYuko Date: Mon, 3 Jun 2024 18:53:27 +0800 Subject: [PATCH] fix(tmux): add completion for alias functions (#12468) --- plugins/tmux/tmux.plugin.zsh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index f65598358..399de1ccc 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/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'