summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bashrc6
1 files changed, 6 insertions, 0 deletions
diff --git a/bashrc b/bashrc
index 916ad2b..5c58c9e 100644
--- a/bashrc
+++ b/bashrc
@@ -49,6 +49,7 @@ esac
# prompt
__prompt_command() {
+ local exit_code=$?
PS1='${TITLE}'
local reset='\[\033[0m\]'
@@ -81,6 +82,11 @@ __prompt_command() {
PS1+=" [\j]"
fi
+ # exit code
+ if [ $exit_code -gt 0 ]; then
+ PS1+=" <$red_b$exit_code$reset>"
+ fi
+
PS1+=" $red\$$reset > "
}
PROMPT_COMMAND=__prompt_command