From de9cd55f40df668b68822aa7226041356cfc6818 Mon Sep 17 00:00:00 2001 From: Platon Pronko Date: Thu, 30 Mar 2023 18:15:22 +0800 Subject: [PATCH] fix(_comp_delimited): prepend prefix to all compreply args Fixes #552. Previously prefix was only prepended if COMPREPLY only contained one argument - this commit fixes it so prefix is prepended to all arguments. --- bash_completion | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index 084465b4227..d8a4a771489 100644 --- a/bash_completion +++ b/bash_completion @@ -833,7 +833,10 @@ _comp_delimited() COMPREPLY=($(compgen "$@" -- "${cur##*"$delimiter"}")) fi - ((${#COMPREPLY[@]} == 1)) && COMPREPLY=(${COMPREPLY/#/$prefix}) + for ((i = 0; i < ${#COMPREPLY[@]}; i++)); do + COMPREPLY[i]=${COMPREPLY[i]/#/$prefix} + done + [[ $delimiter != : ]] || __ltrim_colon_completions "$cur" }