Fallback to Readline built-in dir completion implementation to handle
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 12 Mar 2015 17:08:09 +0200
changeset 736 73748dd9a563
parent 735 26eaadaeb19a
child 737 ead952765cf1
Fallback to Readline built-in dir completion implementation to handle spaces in path.
.bash_completion
--- a/.bash_completion	Wed Feb 25 01:17:28 2015 +0200
+++ b/.bash_completion	Thu Mar 12 17:08:09 2015 +0200
@@ -59,8 +59,7 @@
   local cur
   cur=${COMP_WORDS[COMP_CWORD]}
   if [[ -z "${CDPATH:-}" ]] || [[ $cur == ?(.)?(.)/* ]] || [[ $cur == '~'/* ]]; then
-    COMPREPLY=( $(compgen -d -- "$cur") )
-    COMPREPLY=${COMPREPLY[@]/%//}
+    compopt -o dirnames; COMPREPLY=()
     return 0
   fi
   local i j k