summaryrefslogtreecommitdiffstats
path: root/src/init/starship.bash
diff options
context:
space:
mode:
Diffstat (limited to 'src/init/starship.bash')
-rw-r--r--src/init/starship.bash18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/init/starship.bash b/src/init/starship.bash
index a7e17045a..2d1eb84cb 100644
--- a/src/init/starship.bash
+++ b/src/init/starship.bash
@@ -8,9 +8,9 @@
# data for commands like `slow | slow | fast`, since the timer starts at the start
# of the "fast" command.
-# To solve this, we set a flag `PREEXEC_READY` when the prompt is drawn, and only
-# start the timer if this flag is present. That way, timing is for the entire command,
-# and not just a portion of it.
+# To solve this, we set a flag `STARSHIP_PREEXEC_READY` when the prompt is
+# drawn, and only start the timer if this flag is present. That way, timing is
+# for the entire command, and not just a portion of it.
# Will be run before *every* command (even ones in pipes!)
starship_preexec() {
@@ -18,8 +18,8 @@ starship_preexec() {
local PREV_LAST_ARG=$1
# Avoid restarting the timer for commands in the same pipeline
- if [ "$PREEXEC_READY" = "true" ]; then
- PREEXEC_READY=false
+ if [ "$STARSHIP_PREEXEC_READY" = "true" ]; then
+ STARSHIP_PREEXEC_READY=false
STARSHIP_START_TIME=$(::STARSHIP:: time)
fi
@@ -30,7 +30,7 @@ starship_preexec() {
starship_precmd() {
local NUM_JOBS
# Save the status, because commands in this pipeline will change $?
- STATUS=$?
+ STARSHIP_CMD_STATUS=$?
# 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
@@ -46,12 +46,12 @@ starship_precmd() {
if [[ $STARSHIP_START_TIME ]]; then
STARSHIP_END_TIME=$(::STARSHIP:: time)
STARSHIP_DURATION=$((STARSHIP_END_TIME - STARSHIP_START_TIME))
- PS1="$(::STARSHIP:: prompt --status=$STATUS --jobs="$NUM_JOBS" --cmd-duration=$STARSHIP_DURATION)"
+ PS1="$(::STARSHIP:: prompt --status=$STARSHIP_CMD_STATUS --jobs="$NUM_JOBS" --cmd-duration=$STARSHIP_DURATION)"
unset STARSHIP_START_TIME
else
- PS1="$(::STARSHIP:: prompt --status=$STATUS --jobs="$NUM_JOBS")"
+ PS1="$(::STARSHIP:: prompt --status=$STARSHIP_CMD_STATUS --jobs="$NUM_JOBS")"
fi
- PREEXEC_READY=true # Signal that we can safely restart the timer
+ STARSHIP_PREEXEC_READY=true # Signal that we can safely restart the timer
}
# If the user appears to be using https://github.com/rcaloras/bash-preexec,