From ec03bc620c8a9e30f74e6fcc6dc171a35cd82b1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=87=E3=82=A3=E3=83=AC=E3=83=BC=E3=83=B3?= <116947405+sony-level@users.noreply.github.com> Date: Mon, 24 Aug 2026 18:33:49 +0200 Subject: [PATCH] fix(docker): resolve completion path correctly (#14004) Use `${0:A:h}` to get the absolute plugin directory path before entering the anonymous function, where `$0` refers to the function itself. Store it in a local variable to ensure the completion file path is resolved correctly. Fixes #14003 --- plugins/docker/docker.plugin.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/docker/docker.plugin.zsh b/plugins/docker/docker.plugin.zsh index d07ae60335062..5d1a67e742381 100644 --- a/plugins/docker/docker.plugin.zsh +++ b/plugins/docker/docker.plugin.zsh @@ -58,14 +58,17 @@ fi zmodload -F zsh/files b:zf_mv () { + + local plugin_dir="$1" + # `docker completion` is only available from 23.0.0 on # docker version returns `Docker version 24.0.2, build cb74dfcd85` # with `s:,:` remove the comma after the version, and select third word of it if zstyle -t ':omz:plugins:docker' legacy-completion || \ ! is-at-least 23.0.0 ${${(s:,:z)"$(command docker --version)"}[3]}; then - command cp "${0:h}/completions/_docker" "$ZSH_CACHE_DIR/completions/_docker" + command cp "${plugin_dir}/completions/_docker" "$ZSH_CACHE_DIR/completions/_docker" else local TMPPREFIX="$ZSH_CACHE_DIR/completions/_docker" zf_mv -f -- =( command docker completion zsh ) "$TMPPREFIX" fi -} &| +} "${0:A:h}" &|