Skip to content

Commit 1bf3e25

Browse files
committed
Do not enable it in non-interactive shells
1 parent 8926de0 commit 1bf3e25

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bash-preexec.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ if [[ -z "${BASH_VERSINFO-}" ]] || (( BASH_VERSINFO[0] < 3 || (BASH_VERSINFO[0]
4747
return 1
4848
fi
4949

50+
# We do not enable bash-preexc in non-interactive shells
51+
if [[ $- != *i* ]]; then
52+
return 0
53+
fi
54+
5055
# Avoid duplicate inclusion
5156
if [[ -n "${bash_preexec_imported:-}" || -n "${__bp_imported:-}" ]]; then
5257
return 0

0 commit comments

Comments
 (0)