aboutsummaryrefslogtreecommitdiff
path: root/.bash_profile
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2020-04-19 04:47:44 -0400
committertdro <tdro@users.noreply.github.com>2020-04-19 04:47:44 -0400
commitda85bc2cdffbc5ea065ccca16fd74b3ca25e86d7 (patch)
tree06ede8aa62001057b8492a296a08d059f7ceb27b /.bash_profile
parent9ecc3470cdf7af405b89eda56e0252e27ccb4fb5 (diff)
downloaddotfiles-da85bc2cdffbc5ea065ccca16fd74b3ca25e86d7.tar.gz
dotfiles-da85bc2cdffbc5ea065ccca16fd74b3ca25e86d7.tar.bz2
dotfiles-da85bc2cdffbc5ea065ccca16fd74b3ca25e86d7.zip
.bash_profile: Add return code to PS1
Diffstat (limited to '.bash_profile')
-rw-r--r--.bash_profile6
1 files changed, 3 insertions, 3 deletions
diff --git a/.bash_profile b/.bash_profile
index 386f952..049ebcd 100644
--- a/.bash_profile
+++ b/.bash_profile
@@ -4,9 +4,9 @@
[ "$EUID" != 0 ] && [ -z "$DISPLAY" ] && [ "$(tty)" = '/dev/tty1' ] && exec startx >/dev/null 2>&1;
# set prompt
-PS1_USER='\[\e[0;34m\]\W\[\e[0m\] \[\e[0;34m\]\$\[\e[0m\] '
-PS1_ROOT='\[\e[0;31m\]\W\[\e[0m\] \[\e[0;31m\]\$\[\e[0m\] '
-PS1_SSHD='\[\e[0;32m\]\W\[\e[0m\] \[\e[0;32m\]\$\[\e[0m\] '
+PS1_USER='$(E=$? && [ "$E" != 0 ] && echo "$E ")\[\e[0;34m\]\W\[\e[0m\] \[\e[0;34m\]\$\[\e[0m\] '
+PS1_ROOT='$(E=$? && [ "$E" != 0 ] && echo "$E ")\[\e[0;31m\]\W\[\e[0m\] \[\e[0;31m\]\$\[\e[0m\] '
+PS1_SSHD='$(E=$? && [ "$E" != 0 ] && echo "$E ")\[\e[0;32m\]\W\[\e[0m\] \[\e[0;32m\]\$\[\e[0m\] '
[ "$EUID" != 0 ] && export PS1="$PS1_USER";
[ "$EUID" = 0 ] && export PS1="$PS1_ROOT";