aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-12-20 17:13:34 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-12-20 17:13:34 +1300
commit09bdc8d6aeaf56eb8d288c352ff7225137755dc2 (patch)
tree777b460194418591b2698bbb597d01373a9eec43 /bash
parentReturn not continue in text filename completion (diff)
downloaddotfiles-09bdc8d6aeaf56eb8d288c352ff7225137755dc2.tar.gz
dotfiles-09bdc8d6aeaf56eb8d288c352ff7225137755dc2.zip
Accept all directory names for text completion
Diffstat (limited to 'bash')
-rw-r--r--bash/bash_completion.d/_text_filenames.bash6
1 files changed, 6 insertions, 0 deletions
diff --git a/bash/bash_completion.d/_text_filenames.bash b/bash/bash_completion.d/_text_filenames.bash
index 853bc641..93ed8969 100644
--- a/bash/bash_completion.d/_text_filenames.bash
+++ b/bash/bash_completion.d/_text_filenames.bash
@@ -14,6 +14,12 @@ _text_filenames() {
# Exclude blanks
[[ -n $item ]] || continue
+ # Accept directories
+ if [[ -d $item ]] ; then
+ COMPREPLY[${#COMPREPLY[@]}]=$item
+ continue
+ fi
+
# Exclude files with block, character, pipe, or socket type
[[ ! -b $item ]] || continue
[[ ! -c $item ]] || continue