summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-03-17 18:12:26 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-03-17 18:12:26 +0900
commit923c3a814de39ff906d675834af634252b3d2b3f (patch)
tree6f814c17997b5545d890e74d47aca780f4b847d9 /shell
parent779e3cc5b551d791f9f39df8129a95365bca9da7 (diff)
downloadfzf-923c3a814de39ff906d675834af634252b3d2b3f.tar.gz
[bash] Fix $FZF_COMPLETION_{DIR,PATH}_OPTS to support non-trivial arguments
This used to fail with 'unknown option: World>' export FZF_COMPLETION_PATH_OPTS="--prompt 'Hello World> '"
Diffstat (limited to 'shell')
-rw-r--r--shell/completion.bash6
1 files changed, 3 insertions, 3 deletions
diff --git a/shell/completion.bash b/shell/completion.bash
index d1fc57b9..48f1a547 100644
--- a/shell/completion.bash
+++ b/shell/completion.bash
@@ -311,12 +311,12 @@ __fzf_generic_path_completion() {
else
if [[ $1 =~ dir ]]; then
walker=dir,follow
- rest=${FZF_COMPLETION_DIR_OPTS-}
+ eval "rest=(${FZF_COMPLETION_DIR_OPTS-})"
else
walker=file,dir,follow,hidden
- rest=${FZF_COMPLETION_PATH_OPTS-}
+ eval "rest=(${FZF_COMPLETION_PATH_OPTS-})"
fi
- __fzf_comprun "$4" -q "$leftover" --walker "$walker" --walker-root="$dir" $rest
+ __fzf_comprun "$4" -q "$leftover" --walker "$walker" --walker-root="$dir" "${rest[@]}"
fi | while read -r item; do
printf "%q " "${item%$3}$3"
done