Skip to content

Commit

Permalink
[shell] omit interactiveness checks in completion scripts
Browse files Browse the repository at this point in the history
Typically, the completion scripts are installed by the packaging in the right
location (e.g. `/usr/share/bash-completion/completions/fzf` for bash) and
they’re unlikely to be ever accidentally executed or sourced by a user from a
non-interactive shell.

Therefore, the interactiveness check is removed from the completion scripts.

Signed-off-by: Christoph Anton Mitterer <[email protected]>
  • Loading branch information
calestyo committed Oct 8, 2023
1 parent 0d3a89d commit fdd22da
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
3 changes: 0 additions & 3 deletions shell/completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
# - $FZF_COMPLETION_TRIGGER (default: '**')
# - $FZF_COMPLETION_OPTS (default: empty)

[[ $- =~ i ]] || return 0


# To use custom commands instead of find, override _fzf_compgen_{path,dir}
if ! declare -F _fzf_compgen_path > /dev/null; then
_fzf_compgen_path() {
Expand Down
3 changes: 0 additions & 3 deletions shell/completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
# - $FZF_COMPLETION_TRIGGER (default: '**')
# - $FZF_COMPLETION_OPTS (default: empty)

[[ -o interactive ]] || return 0


# Both branches of the following `if` do the same thing -- define
# __fzf_completion_options such that `eval $__fzf_completion_options` sets
# all options to the same values they currently have. We'll do just that at
Expand Down

0 comments on commit fdd22da

Please sign in to comment.