From db538445b1aa72c45300d05eb24794a435f27774 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 9 Dec 2016 10:54:17 +1300 Subject: Prevent man(1) completion interfering with paths --- bash/bash_completion.d/man.bash | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bash') diff --git a/bash/bash_completion.d/man.bash b/bash/bash_completion.d/man.bash index 9861e9dd..7d25fdd2 100644 --- a/bash/bash_completion.d/man.bash +++ b/bash/bash_completion.d/man.bash @@ -8,6 +8,12 @@ _man() { local word word=${COMP_WORDS[COMP_CWORD]} + # Don't bother if the word has slashes in it, the user is probably trying + # to complete an actual path + case $word in + */*) return 1 ;; + esac + # If this is the second word, and the previous word started with a number, # we'll assume that's the section to search local section subdir -- cgit v1.2.3