Closed FranklinYu closed 2 years ago
I'd advocate for 2. It's not intended to be part of the public api (given the prefix), but I think it's much more practical. If needed feel free to submit a PR to rename to remove the underscores.
__bp_imported
is what I check as well: https://github.com/dimo414/prompt.gem/blob/8a8d415052abd51f7c089df8473b7b64a7768d65/commands.sh#L25
[[ "$(declare -p preexec_functions)" =~ "declare -a" ]] 2>/dev/null
[[ -n ${__bp_imported} ]]
Concern with 1 is that the test suite doesn’t guarantee existence of variable
preexec_functions
; note that in a fresh Zsh, this variable is undeclared. Concern with 2 is that I’m not sure whether this is part of the public API (given the__bp_
prefix).