From ba3f8a9fefc9da16dc00cf01f2b1d32ec54ce20d Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Mon, 2 May 2016 09:45:01 -0400 Subject: [PATCH] Make zsh completion work when ps output is custom When `psFormat` is used in the docker client config json, if the output is non-standard it breaks some of the completion handling for containers. This fixes that by ensuring that calls to `ps` use the default/standard formatting by calling `docker ps --format 'table'` Signed-off-by: Brian Goff --- 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 d90a9d65d7..68a3fab7b3 100644 --- a/contrib/completion/zsh/_docker +++ b/contrib/completion/zsh/_docker @@ -57,7 +57,7 @@ __docker_get_containers() { type=$1; shift [[ $kind = (stopped|all) ]] && args=($args -a) - lines=(${(f)"$(_call_program commands docker $docker_options ps --no-trunc $args)"}) + lines=(${(f)"$(_call_program commands docker $docker_options ps --format 'table' --no-trunc $args)"}) # Parse header line to find columns local i=1 j=1 k header=${lines[1]}