summaryrefslogtreecommitdiffstats
path: root/shell/completion.bash
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2019-02-28 16:13:59 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2019-02-28 16:13:59 +0900
commit8cf45a519788c42ae4312fe9295e3cd9b988f372 (patch)
tree5cbae324d18abdf35de68e2bbb5ded0ba805e26d /shell/completion.bash
parent8dc1377efb140c40c7e121b29d9cedb52ad9ea9f (diff)
[shell] Skip loading completion code on non-interactive shell
This change is not required if you use the install script to generate ~/.fzf.bash or ~/.fzf.zsh which already has the proper guard statement. Close #1474
Diffstat (limited to 'shell/completion.bash')
-rw-r--r--shell/completion.bash4
1 files changed, 4 insertions, 0 deletions
diff --git a/shell/completion.bash b/shell/completion.bash
index 93369954..8805cb3d 100644
--- a/shell/completion.bash
+++ b/shell/completion.bash
@@ -9,6 +9,8 @@
# - $FZF_COMPLETION_TRIGGER (default: '**')
# - $FZF_COMPLETION_OPTS (default: empty)
+if [[ $- =~ i ]]; then
+
# To use custom commands instead of find, override _fzf_compgen_{path,dir}
if ! declare -f _fzf_compgen_path > /dev/null; then
_fzf_compgen_path() {
@@ -330,3 +332,5 @@ complete -F _fzf_complete_export -o default -o bashdefault export
complete -F _fzf_complete_unalias -o default -o bashdefault unalias
unset cmd d_cmds a_cmds x_cmds
+
+fi