aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/bd.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-10-20 14:42:45 +1300
committerTom Ryder <tom@sanctum.geek.nz>2015-10-20 14:42:45 +1300
commitf4d28a49dea60bf473b92cb6290cebdfbe4673cb (patch)
tree0217e239a0a66f633a4dfba8f369c92cb28090d1 /bash/bashrc.d/bd.bash
parentFix consistent spacing in muttrc (diff)
downloaddotfiles-f4d28a49dea60bf473b92cb6290cebdfbe4673cb.tar.gz
dotfiles-f4d28a49dea60bf473b92cb6290cebdfbe4673cb.zip
Handle spaces correctly in completions
This is technically still wrong; COMPREPLY needs to be specified with null-delimited IFS, as done in the pass() function. This will do for now.
Diffstat (limited to 'bash/bashrc.d/bd.bash')
-rw-r--r--bash/bashrc.d/bd.bash2
1 files changed, 2 insertions, 0 deletions
diff --git a/bash/bashrc.d/bd.bash b/bash/bashrc.d/bd.bash
index 5d26e2b9..110fca06 100644
--- a/bash/bashrc.d/bd.bash
+++ b/bash/bashrc.d/bd.bash
@@ -91,6 +91,8 @@ _bd() {
done < <(printf %s "$PWD")
# Complete with matching dirs
+ compopt -o filenames
+ local IFS=$'\n'
COMPREPLY=( $(compgen -W "${dirs[*]}" -- "$word") )
}
complete -F _bd bd