undistract-me is incompatible with any other script that relies on bash_preexec, for instance bash-timer.
That is because undistract-me uses variables precmd and preexec to pass its callback functions to bash-preexec. If any other script does the same thing, then whichever is sourced last overwrites these variables and the callbacks of the other scripts are discarded.
To solve this problem, newer versions of bash-preexec provide arrays precmd_functions and preexec_functions, where several scripts can append their callback functions without overwriting / discarding those of other scripts.
I applied and tested these modifications on my machine. They work. Could you consider merging them ? Let me know if you want any additional information / help for testing / etc.
undistract-me
is incompatible with any other script that relies onbash_preexec
, for instance bash-timer.That is because
undistract-me
uses variablesprecmd
andpreexec
to pass its callback functions tobash-preexec
. If any other script does the same thing, then whichever is sourced last overwrites these variables and the callbacks of the other scripts are discarded.To solve this problem, newer versions of
bash-preexec
provide arraysprecmd_functions
andpreexec_functions
, where several scripts can append their callback functions without overwriting / discarding those of other scripts.This pull requests addresses the issue described above by :
1/ updating
preexec.bash
to the latest version found in https://glyf.livejournal.com/63106.html, that is https://www.twistedmatrix.com/users/glyph/preexec.bash.txt2/ using the callback arrays instead of variables
I applied and tested these modifications on my machine. They work. Could you consider merging them ? Let me know if you want any additional information / help for testing / etc.
Cheers !