Include error code into PS1. Use \r trick even without colors.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 18 Jan 2016 16:47:51 +0200
changeset 784 8a961df3ec33
parent 783 b1ace79cf017
child 785 ec32614ca2bc
Include error code into PS1. Use \r trick even without colors.
.bashrc
--- a/.bashrc	Mon Jan 18 01:18:55 2016 +0200
+++ b/.bashrc	Mon Jan 18 16:47:51 2016 +0200
@@ -9,11 +9,11 @@
   . ~/.env
 fi
 
-PS1='\nbash# '
+PS1='\n================================================================\r$?|\u@\h \w \nbash# '
 PS2='> '
 case "$TERM" in
   xterm*|eterm-color|screen|linux)
-    PS1='\n\033[36m================================================================\r\033[31m\u\033[35m@\h\033[0m\033[36m \w \n\[\033[1m\033[31m\]bash#\[\033[0m\] '
+    PS1='\n\033[36m================================================================\r$?|\033[31m\u\033[35m@\h\033[0m\033[36m \w \n\[\033[1m\033[31m\]bash#\[\033[0m\] '
     PS2='\[\033[32m\]> \[\033[0m\]'
   ;;
 esac