aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/prompt.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-07-07 14:46:29 +1200
committerTom Ryder <tom@sanctum.geek.nz>2014-07-07 14:46:29 +1200
commit6c5adf98a483df99ab9333421b0c3f8b6e77cdd6 (patch)
treeab97c3537280ccfed330c4b36742ef7ff539e27b /bash/bashrc.d/prompt.bash
parentUse one-arg form of printf for static strings (diff)
downloaddotfiles-6c5adf98a483df99ab9333421b0c3f8b6e77cdd6.tar.gz
dotfiles-6c5adf98a483df99ab9333421b0c3f8b6e77cdd6.zip
Use PROMPT_RETURN instead of just ret
Conflicts with ret variable in older versions of bash_completion. Normally don't like defining capital-var variables but I think it's appropriate in this case.
Diffstat (limited to 'bash/bashrc.d/prompt.bash')
-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 454f2d4b..2c5034f2 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -7,7 +7,7 @@ prompt() {
# Turn complex, colored prompt on
on)
# Set up pre-prompt command and prompt format
- PROMPT_COMMAND='declare -i ret=$? ; history -a'
+ PROMPT_COMMAND='declare -i PROMPT_RETURN=$? ; history -a'
PS1='[\u@\h:\w]$(prompt vcs)$(prompt job)$(prompt ret)\$'
# If Bash 4.0 is available, trim very long paths in prompt
@@ -51,7 +51,7 @@ prompt() {
# Revert to simple inexpensive prompt
off)
- unset -v PROMPT_COMMAND PROMPT_DIRTRIM ret
+ unset -v PROMPT_COMMAND PROMPT_DIRTRIM PROMPT_RETURN
PS1='\$ '
;;
@@ -216,8 +216,8 @@ prompt() {
# Show return status of previous command in angle brackets, if not zero
ret)
- if ((ret > 0)) ; then
- printf '<%d>' "$ret"
+ if ((PROMPT_RETURN > 0)) ; then
+ printf '<%d>' "$PROMPT_RETURN"
fi
;;