Closed anhnamtran closed 5 years ago
@anhnamtran Not sure why the DEBUG trap isn't being reset here. You can also try to add some additional debugging to bash-preexec.sh during the reinstall. The trap should actually be set as part of PROMPT_COMMAND
on https://github.com/rcaloras/bash-preexec/blob/9811ba8b7694cdbd9debed931e922b67e439197a/bash-preexec.sh#L323 You can probably add some additional logging either in PROMPT_COMMAND as a part of that line, or just before and after to make sure it's being executed. Bash may be preventing it from being set for some reason as well. Lets see if that additional debugging suggests it's being run. Hope that helps!
Closing. Feel free to re-open @anhnamtran if this is still an issue.
Hi, I was wondering if there is a way to "reinstall" Bash-preexec.
Desired behavior:
source bash-preexec.sh
and define the functions.bash-preexec.sh
and runningexec bash
.source bash-preexec.sh
and defining the functions.Debugging output:
Actual behavior:
precmd
functions.Debugging output:
As you can see, oddly enough, only the
trap
is different. I've discovered that it's becauseexec bash
in my terminal does not change$PROMPT_COMMAND
.I looked through the source code in
bash-preexec.sh
, and saw that you check$PROMPT_COMMAND
before creating the trap. I have tried doingexport PROMPT_COMMAND=""
in my "uninstall" step (afterexec bash
), but that still created the same behavior as the "Actual" behavior.I was wondering if I'm doing anything wrong or if there's a cleaner way to uninstall and reinstall BP.