aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/ud.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/ud.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/ud.bash')
-rw-r--r--bash/bashrc.d/ud.bash2
1 files changed, 2 insertions, 0 deletions
diff --git a/bash/bashrc.d/ud.bash b/bash/bashrc.d/ud.bash
index 5bcfc2ed..b5279004 100644
--- a/bash/bashrc.d/ud.bash
+++ b/bash/bashrc.d/ud.bash
@@ -54,6 +54,8 @@ _ud() {
if ((COMP_CWORD == 2)) ; then
local word
word=${COMP_WORDS[COMP_CWORD]}
+ compopt -o filenames
+ local IFS=$'\n'
COMPREPLY=( $(compgen -A directory -- "$word" ) )
else
return 1