Commit Graph

14 Commits (fdff1d81cd558d916eef9bcd3ce6f81a34b9af5b)

Author SHA1 Message Date
John D Pell 8246794a28 lib/preexec: the last remnants of the `$OSTYPE` have been swept away
- Use a POSIX-compliant/portable extended regular expression to match on word-boundaries, rather than guessing which regex library `bash` was linked against. See https://stackoverflow.com/a/12696899/555333 for explanation and code suggestion.
2022-02-16 16:10:41 -08:00
John D Pell c1943192ce lib/preexec: clarify subshell guard and comment
Rewrite comment on disabling the `DEBUG` trap in subshells, which is now handled upstream as of rcaloras/bash-preexec#26.

Alsö, fix the guard variable assignment to allow it to be overridden elsewhere (e.g., for testing).
2022-02-16 16:10:41 -08:00
John D Pell a93919625d lib/preexec: adobt `_bash_it_library_finalize_hook`
Schedule modification of `$PROMPT_COMMAND` for after everything has loaded.
2022-02-16 16:10:41 -08:00
John D Pell 6b08284928 Update "preexec" from "https://github.com/rcaloras/bash-preexec@master"
git-vendor-name: preexec
git-vendor-dir: vendor/github.com/rcaloras/bash-preexec
git-vendor-repository: https://github.com/rcaloras/bash-preexec
git-vendor-ref: fd2ffa8876d3940c97ffdc3cc807e43277cf72da
2022-02-16 16:10:41 -08:00
Noah Gorny 056c392a54 lib: preexec: Properly return if there was a conflict in check_*_conflict
It goes the other way around!
2022-01-26 18:25:37 +02:00
John D Pell ae8c9c08a3 lib/preexec: trim whitespace
Alsö, use `_bash-it-array-contains-element()`
2022-01-25 13:00:04 -08:00
John D Pell 7770e8cbb9 lib/preexec: log an error if `bash-preexec` not loaded 2022-01-25 13:00:04 -08:00
John D Pell 9f146f937a lib/preexec: consolidate helper functions
Define the helper functions for `bash-preexec.sh` immediately after importing it, rather than in `lib/theme`.
- `__check_precmd_conflict()` and `save_append_prompt_command()` are generally useful and not theme-specific.
- Add matching `__check_preexec_conflict()` and `safe_append_preexec()`.
2022-01-25 13:00:04 -08:00
John D Pell 7a0b353cea lib/preexec: rename `vendor/init.d/preexec.bash` 2022-01-25 13:00:04 -08:00
buhl 29855ed1e6 Adding preexec as a vendored library
Added a vendored lib loading routine in bash-it.sh
Added documentation on how to vendor libs in bash-it
Added and fixed plugins using preexec
Added tests for two plugins
Removed the old preexec lib
2021-01-23 18:31:18 +01:00
Eduardo Bellido Bellido 1bf9bbde0d Use new line character instead semicolon in the preexec hook 2020-03-14 22:56:30 +01:00
Eric Anders 3b56275ef6
Check for empty or whitespace PROMPT_COMMAND before appending preexec_invoke_cmd 2016-08-04 15:51:15 -05:00
Eitan Adler 3fc60b5358 Fix bogus bash binary location 2012-04-17 00:24:58 -04:00
Antono Vasiljev bd61f6e180 Added bash functions preexec() and precmd() 2011-12-17 11:45:59 +03:00