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

pull/12473/head
MoetaYuko 2024-06-03 18:53:27 +08:00 committed by GitHub
parent e0c6cb1470
commit 56afe7b368
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 0 deletions

View File

@ -57,6 +57,19 @@ function _build_tmux_alias {
tmux $2 $3 \"\$@\" tmux $2 $3 \"\$@\"
fi 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' alias tksv='tmux kill-server'