From 7c9831d376a6c048ae9f95b435cdde9dc14358a0 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Mon, 20 Jun 2022 00:11:21 -0400 Subject: [PATCH] Fix handling of descriptions for bash v3 (#1735) 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 d295791e6..767bf0312 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