From c4dd093b56b70e7c37364a267ed04877c449270d Mon Sep 17 00:00:00 2001 From: FrancescoCastaldi Date: Thu, 27 Aug 2026 16:38:20 +0200 Subject: [PATCH] completion: fix zsh __docker_plugins bad math expression The TAG column no longer exists in 'docker plugin ls' output. When the function tried to extract the non-existent TAG column, it received an empty string, which caused a 'bad math expression' error in zsh. Fix by reading the ID column instead, and correct the padding direction from l: (left-pad) to r: (right-truncate) so that IDs are correctly shortened to 7 characters from the right. Fixes #2761 --- contrib/completion/zsh/_docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/zsh/_docker b/contrib/completion/zsh/_docker index 486e5a5d17b4..6468bb4af2c8 100644 --- a/contrib/completion/zsh/_docker +++ b/contrib/completion/zsh/_docker @@ -1575,7 +1575,7 @@ __docker_plugins() { # Name for line in $lines; do s="${line[${begin[NAME]},${end[NAME]}]%% ##}" - s="$s:${(l:7:: :::)${${line[${begin[TAG]},${end[TAG]}]}%% ##}}" + s="$s:${(r:7:: :::)${${line[${begin[ID]},${end[ID]}]}%% ##}}" plugins=($plugins $s) done