Skip to content

Commit

Permalink
handle debug traps with [[ specially (#157544)
Browse files Browse the repository at this point in the history
* fix #154189

* add comment
  • Loading branch information
meganrogge committed Aug 8, 2022
1 parent ff1d2ab commit 9395d5e
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,14 @@ if [[ -n "${bash_preexec_imported:-}" ]]; then
precmd_functions+=(__vsc_prompt_cmd)
preexec_functions+=(__vsc_preexec_only)
else
__vsc_dbg_trap="$(trap -p DEBUG | cut -d' ' -f3 | tr -d \')"
__vsc_dbg_trap="$(trap -p DEBUG)"
if [[ "$__vsc_db_trap" =~ .*\[\[.* ]]; then
#HACK - is there a better way to do this?
__vsc_dbg_trap=${__vsc_dbg_trap#'trap -- '*}
__vsc_dbg_trap=${__vsc_dbg_trap%'DEBUG'}
else
__vsc_dbg_trap="$(trap -p DEBUG | cut -d' ' -f3 | tr -d \')"
fi
if [[ -z "$__vsc_dbg_trap" ]]; then
__vsc_preexec_only() {
if [ "$__vsc_in_command_execution" = "0" ]; then
Expand Down

0 comments on commit 9395d5e

Please sign in to comment.