1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-12 21:32:21 +00:00

fix(bash): Fix broken bash init script (#2100)

This fixes a regression where the exit code of the most recently run
command was not correctly recorded in the bash init script.
This commit is contained in:
Thomas O'Donnell 2021-01-07 18:35:32 +01:00 committed by GitHub
parent 452694903c
commit 8cd4850ab6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,10 +28,10 @@ starship_preexec() {
# Will be run before the prompt is drawn
starship_precmd() {
local NUM_JOBS
# Save the status, because commands in this pipeline will change $?
STARSHIP_CMD_STATUS=$?
local NUM_JOBS
# Evaluate the number of jobs before running the preseved prompt command, so that tools
# like z/autojump, which background certain jobs, do not cause spurious background jobs
# to be displayed by starship. Also avoids forking to run `wc`, slightly improving perf