Skip to content

Commit c194319

Browse files
committed
lib/preexec: clarify subshell guard and comment
Rewrite comment on disabling the `DEBUG` trap in subshells, which is now handled upstream as of rcaloras/bash-preexec#26. Alsö, fix the guard variable assignment to allow it to be overridden elsewhere (e.g., for testing).
1 parent a939196 commit c194319

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/preexec.bash

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ function __bp_adjust_histcontrol() { :; }
1717
# Don't fail on readonly variables
1818
function __bp_require_not_readonly() { :; }
1919

20-
# Disable trap DEBUG on subshells - https://github.com/Bash-it/bash-it/pull/1040
21-
__bp_enable_subshells= # blank
20+
# For performance, testing, and to avoid unexpected behavior: disable DEBUG traps in subshells.
21+
# See bash-it/bash-it#1040 and rcaloras/bash-preexec#26
22+
: "${__bp_enable_subshells:=}" # blank
2223

2324
# Modify `$PROMPT_COMMAND` in finalize hook
2425
_bash_it_library_finalize_hook+=('__bp_install_after_session_init')

0 commit comments

Comments
 (0)