mirror of
https://github.com/starship/starship.git
synced 2024-11-26 18:24:28 +01:00
fix(bash): bash-preexec detection and implementation (#2091)
* Fix bash-preexec detection and implementation * Add detection for other arrays
This commit is contained in:
parent
435ec17b42
commit
55c3cafd94
@ -56,8 +56,10 @@ starship_precmd() {
|
|||||||
|
|
||||||
# If the user appears to be using https://github.com/rcaloras/bash-preexec,
|
# If the user appears to be using https://github.com/rcaloras/bash-preexec,
|
||||||
# then hook our functions into their framework.
|
# then hook our functions into their framework.
|
||||||
if [[ $preexec_functions ]]; then
|
if [[ "${__bp_imported:-}" == "defined" || $preexec_functions || $precmd_functions ]]; then
|
||||||
preexec_functions+=('starship_preexec "$_"')
|
# bash-preexec needs a single function--wrap the args into a closure and pass
|
||||||
|
starship_preexec_all(){ starship_preexec "$_"; }
|
||||||
|
preexec_functions+=(starship_preexec_all)
|
||||||
precmd_functions+=(starship_precmd)
|
precmd_functions+=(starship_precmd)
|
||||||
else
|
else
|
||||||
# We want to avoid destroying an existing DEBUG hook. If we detect one, create
|
# We want to avoid destroying an existing DEBUG hook. If we detect one, create
|
||||||
|
Loading…
Reference in New Issue
Block a user