Skip to content

Commit

Permalink
Add option to disable subshells to help with #25
Browse files Browse the repository at this point in the history
  • Loading branch information
rcaloras committed Jul 25, 2016
1 parent f2370fe commit d76f3d2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions bash-preexec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# Author: Ryan Caloras (ryan@bashhub.com)
# Forked from Original Author: Glyph Lefkowitz
#
# V0.3.0
# V0.3.1
#

# General Usage:
Expand Down Expand Up @@ -234,9 +234,17 @@ __bp_install() {
# Adjust our HISTCONTROL Variable if needed.
__bp_adjust_histcontrol

# Set so debug trap will work be invoked in subshells.
set -o functrace > /dev/null 2>&1
shopt -s extdebug > /dev/null 2>&1

# Issue #25. Setting debug trap for subshells causes sessions to exit for
# backgrounded subshell commands (e.g. (pwd)& ). Believe this is a bug in Bash.
#
# This option allows you to disable subshells.
if [[ -z "$__bp_disable_subshells" ]]; then

# Set so debug trap will work be invoked in subshells.
set -o functrace > /dev/null 2>&1
shopt -s extdebug > /dev/null 2>&1
fi;


local existing_prompt_command
Expand Down

0 comments on commit d76f3d2

Please sign in to comment.