summaryrefslogtreecommitdiff
path: root/shell/completion.bash
diff options
context:
space:
mode:
Diffstat (limited to 'shell/completion.bash')
-rw-r--r--shell/completion.bash3
1 files changed, 2 insertions, 1 deletions
diff --git a/shell/completion.bash b/shell/completion.bash
index 191091d0..ef3a965c 100644
--- a/shell/completion.bash
+++ b/shell/completion.bash
@@ -110,7 +110,8 @@ __fzf_generic_path_completion() {
if [ -z "$dir" -o -d "$dir" ]; then
leftover=${base/#"$dir"}
leftover=${leftover/#\/}
- [ -z "$dir" ] && dir='.' || dir="${dir/%\//}"
+ [ -z "$dir" ] && dir='.'
+ [ "$dir" != "/" ] && dir="${dir/%\//}"
tput sc
matches=$(\find -L "$dir" $1 -a -not -path "$dir" -print 2> /dev/null | sed 's@^\./@@' | $fzf $FZF_COMPLETION_OPTS $2 -q "$leftover" | while read item; do
printf "%q$3 " "$item"