From c55d5f8142e48ae9f9a21cda3c82e4c4c9198fb9 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 7 Aug 2026 16:57:14 +0800 Subject: fix(zsh): guard compdef call with function check If compdef is not available, fall back to compctl directly without invoking an undefined command. --- mingling_core/tmpls/comps/zsh.zsh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mingling_core') diff --git a/mingling_core/tmpls/comps/zsh.zsh b/mingling_core/tmpls/comps/zsh.zsh index f665133..7cf5f7b 100644 --- a/mingling_core/tmpls/comps/zsh.zsh +++ b/mingling_core/tmpls/comps/zsh.zsh @@ -61,8 +61,11 @@ _<<>>_completion() { fi } -compdef _<<>>_completion <<>> - -if [[ $? -ne 0 ]]; then +if (( $+functions[compdef] )); then + compdef _<<>>_completion <<>> + if [[ $? -ne 0 ]]; then + compctl -K _<<>>_completion <<>> + fi +else compctl -K _<<>>_completion <<>> fi -- cgit