diff --git a/ocaml/xe-cli/bash-completion b/ocaml/xe-cli/bash-completion index 98df8be24fb..b4ba6127138 100644 --- a/ocaml/xe-cli/bash-completion +++ b/ocaml/xe-cli/bash-completion @@ -771,7 +771,12 @@ __preprocess_suggestions() wordlist=$( echo "$1" | \ sed -re 's/(^|[^\])((\\\\)*),,*/\1\2\n/g' -e 's/\\,/,/g' -e 's/\\\\/\\/g' | \ sed -e 's/ *$//') - compgen -W "$wordlist" "$prefix" + local IFS=$'\n' + for word in $wordlist; do + if [[ "$word" =~ ^$prefix.* ]]; then + echo "$word" + fi + done } # set_completions suggestions current_prefix description_cmd