aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2022-04-30 20:24:47 +1200
committerTom Ryder <tom@sanctum.geek.nz>2022-04-30 20:32:41 +1200
commit41a6006ed57f611e24243be708e34850ab921fb4 (patch)
tree2654892332c0d8b3a74b7ba2607ba3359cd7dd1f /bash/bashrc.d
parentAdd a comment (diff)
downloaddotfiles-41a6006ed57f611e24243be708e34850ab921fb4.tar.gz
dotfiles-41a6006ed57f611e24243be708e34850ab921fb4.zip
Correct prompt status writing broken by preload
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r--bash/bashrc.d/prompt.bash8
1 files changed, 4 insertions, 4 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 86691a9c..bdea7ace 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -7,7 +7,7 @@ prompt() {
# Turn complex, colored PS1 and debugging PS4 prompts on
on)
# Set up pre-prompt command
- PROMPT_COMMAND='history -a'
+ PROMPT_COMMAND='PROMPT_RETURN=$?;history -a'
# If Bash 4.0 is available, trim very long paths in prompt
if ((BASH_VERSINFO[0] >= 4)) ; then
@@ -31,7 +31,7 @@ prompt() {
## Preload libraries as prefix
PS1='$(prompt preload)'$PS1
## VCS, job, and return status checks as suffixes
- PS1=$PS1'$(ret=$?;prompt vcs;prompt job;prompt ret)'
+ PS1=$PS1'$(prompt vcs;prompt job;prompt ret)'
# Add prefix and suffix
PS1='${PROMPT_PREFIX}'$PS1'${PROMPT_SUFFIX}'
@@ -267,8 +267,8 @@ prompt() {
# Show return status of previous command in angle brackets, if not zero
ret)
# shellcheck disable=SC2154
- ((ret)) || return
- printf '<%u>' "${ret//\\/\\\\}"
+ ((PROMPT_RETURN)) || return
+ printf '<%u>' "${PROMPT_RETURN//\\/\\\\}"
;;
# Show the count of background jobs in curly brackets, if not zero