various fixes, a few new features
[distro-setup] / brc
diff --git a/brc b/brc
index 7d58392d65fe59e5870d862232690bb74a527291..1539a767e0aaec91969f25b49234eb1dbc40b503 100644 (file)
--- a/brc
+++ b/brc
@@ -1013,7 +1013,7 @@ ccomp tail etail etail2
 
 showkeys() {
   ssh "$@" cat .ssh/authorized_keys{,2}
-  }
+}
 
 
 # print exim old pids
@@ -2573,6 +2573,10 @@ if [[ $- == *i* ]]; then
     if [[ $MAIL_HOST && $MAIL_HOST != "$HOSTNAME" ]]; then
       ps_char="@ $ps_char"
     fi
+    jobs_char=
+    if [[ $(jobs -p) ]]; then
+      jobs_char='\j '
+    fi
     # We could test if sudo is active with sudo -nv
     # but then we get an email and log of lots of failed sudo commands.
     # We could turn those off, but seems better not to.
@@ -2582,7 +2586,7 @@ if [[ $- == *i* ]]; then
     if [[ ! $HISTFILE ]]; then
       ps_char="NOHIST $ps_char"
     fi
-    PS1="${PS1%"${PS1#*[wW]}"} $psudo\[$ps_color\]$ps_char\[$term_nocolor\] "
+    PS1="${PS1%"${PS1#*[wW]}"} $jobs_char$psudo\[$ps_color\]$ps_char\[$term_nocolor\] "
 
     # set titlebar. instead, using more advanced
     # titelbar below