Skip to content

Commit

Permalink
fix(bash): improve integration with bash-preexec (#5734)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkna committed Feb 4, 2024
1 parent 428d840 commit 2aa711c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/init/starship.bash
Expand Up @@ -36,7 +36,7 @@ starship_precmd() {
if [[ ${BLE_ATTACHED-} && ${#BLE_PIPESTATUS[@]} -gt 0 ]]; then
STARSHIP_PIPE_STATUS=("${BLE_PIPESTATUS[@]}")
fi
if [[ -n "${BP_PIPESTATUS-}" ]] && [[ "${#BP_PIPESTATUS[@]}" -gt "${#STARSHIP_PIPE_STATUS[@]}" ]]; then
if [[ -n "${BP_PIPESTATUS-}" ]] && [[ "${#BP_PIPESTATUS[@]}" -gt 0 ]]; then
STARSHIP_PIPE_STATUS=(${BP_PIPESTATUS[@]})
fi

Expand Down Expand Up @@ -92,7 +92,7 @@ if [[ ${BLE_VERSION-} && _ble_version -ge 400 ]]; then
blehook PRECMD!='starship_precmd'
# If the user appears to be using https://github.com/rcaloras/bash-preexec,
# then hook our functions into their framework.
elif [[ "${__bp_imported:-}" == "defined" || -n "${preexec_functions-}" || -n "${precmd_functions-}" ]]; then
elif [[ -n "${bash_preexec_imported:-}" || -n "${__bp_imported:-}" || -n "${preexec_functions-}" || -n "${precmd_functions-}" ]]; then
# bash-preexec needs a single function--wrap the args into a closure and pass
starship_preexec_all(){ starship_preexec "$_"; }
preexec_functions+=(starship_preexec_all)
Expand Down

0 comments on commit 2aa711c

Please sign in to comment.