Skip to content

Commit

Permalink
Fix handling of descriptions for bash v3 (#1735)
Browse files Browse the repository at this point in the history
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 <marc.khouzam@gmail.com>
  • Loading branch information
marckhouzam authored Jun 20, 2022
1 parent ed7bb9d commit 7c9831d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bash_completionsV2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7c9831d

Please sign in to comment.