aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-08-26 15:09:22 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-08-26 15:09:22 +1200
commite4ad3ed3e2fa5b0c0e59cabf8662781d1b47a5b3 (patch)
treeee11f01d2714b593da97738eb0e2ce7726182162 /bash
parentUse single quotes for printf (diff)
downloaddotfiles-e4ad3ed3e2fa5b0c0e59cabf8662781d1b47a5b3.tar.gz
dotfiles-e4ad3ed3e2fa5b0c0e59cabf8662781d1b47a5b3.zip
Rearrange prompt to put last return status last
Diffstat (limited to '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 6d273185..a3baaa3b 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -2,17 +2,17 @@
prompt() {
# Variables for use only within this function
- local -i ret=$? colors=$(tput colors)
- local -a state=()
local color reset branch info url root
+ local -i colors=$(tput colors)
+ local -a state=()
# What's done next depends on the first argument to the function
case $1 in
# Turn complex, colored prompt on
on)
- PROMPT_COMMAND='history -a'
- PS1='\[\a\][\u@\h:\w]$(prompt ret)$(prompt vcs)$(prompt job)\$'
+ PROMPT_COMMAND='ret=$? ; history -a'
+ PS1='\[\a\][\u@\h:\w]$(prompt vcs)$(prompt job)$(prompt ret)\$'
# Check if we have non-bold bright green available
if ((colors > 8)); then