aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-11-27 09:47:55 +1300
committerTom Ryder <tom@sanctum.geek.nz>2015-11-27 09:47:55 +1300
commit90df44b6c29926f05957cef781ef22d374c8cb6a (patch)
tree42ab4e7cee8bbb1c7b0bfa75dc6eb30290dfb612 /bash/bashrc
parentFix COMP_WORDBREAKS (diff)
downloaddotfiles-90df44b6c29926f05957cef781ef22d374c8cb6a.tar.gz
dotfiles-90df44b6c29926f05957cef781ef22d374c8cb6a.zip
Strip colons from COMP_WORDBREAKS
<http://tiswww.case.edu/php/chet/bash/FAQ> E13
Diffstat (limited to 'bash/bashrc')
-rw-r--r--bash/bashrc11
1 files changed, 6 insertions, 5 deletions
diff --git a/bash/bashrc b/bash/bashrc
index a8c4b498..ddd3ce3b 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -98,11 +98,12 @@ if ((BASH_VERSINFO[0] == 4)) ; then
fi
fi
-# Set a simpler custom COMPWORDS to exclude colons; a colon, even unescaped, is
-# not part of the shell syntax and it could well be part of filenames, so it
-# should not be subject to wordsplitting in completion. Otherwise it messes up
-# completion for e.g. Perl library man(1) pages (Net::DNS, Perl::Critic etc)
-COMP_WORDBREAKS=' ><=;|&("'\'$'\n'
+# If COMP_WORDBREAKS has a value, strip all colons from it; this allows
+# completing filenames correctly, since an unquoted colon is not a syntactic
+# character: <http://tiswww.case.edu/php/chet/bash/FAQ> (E13)
+if [[ $COMP_WORDBREAKS ]] ; then
+ COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
+fi
# Load any supplementary scripts
if [[ -d $HOME/.bashrc.d ]] ; then