diff --git a/bash-preexec.sh b/bash-preexec.sh index 641346a..7c69d3c 100644 --- a/bash-preexec.sh +++ b/bash-preexec.sh @@ -47,6 +47,11 @@ if [[ -z "${BASH_VERSINFO-}" ]] || (( BASH_VERSINFO[0] < 3 || (BASH_VERSINFO[0] return 1 fi +# We do not enable bash-preexc in non-interactive shells +if [[ $- != *i* ]]; then + return 0 +fi + # Avoid duplicate inclusion if [[ -n "${bash_preexec_imported:-}" || -n "${__bp_imported:-}" ]]; then return 0