From 9b87f1e06bf8f1a7b8d64b651d0fa136cff7fcea Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Sun, 19 Jun 2022 23:59:48 -0400 Subject: [PATCH] Fix handling of descriptions for bash v3 Fixes #1734 Tab characters that introduce completion descriptions weren't properly being handled with bash v3. This change fixes that. Signed-off-by: Marc Khouzam --- bash_completionsV2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_completionsV2.go b/bash_completionsV2.go index d295791e..767bf031 100644 --- a/bash_completionsV2.go +++ b/bash_completionsV2.go @@ -219,7 +219,7 @@ __%[1]s_handle_standard_completion_case() { local tab=$'\t' comp # Short circuit to optimize if we don't have descriptions - if [[ ${completions[*]} != *$tab* ]]; then + if [[ "${completions[*]}" != *$tab* ]]; then IFS=$'\n' read -ra COMPREPLY -d '' < <(compgen -W "${completions[*]}" -- "$cur") return 0 fi