jml / undistract-me

Notifies you when long-running terminal commands complete
Other
540 stars 48 forks source link

Fix incompatibilities with any other scripts that use `bash-preexec` #68

Open qbouvet opened 4 years ago

qbouvet commented 4 years ago

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.

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.txt
2/ 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 !

qbouvet commented 4 years ago

See Issue #68

georgefst commented 1 year ago

See Issue #68

I think you mean #67.