aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc8
1 files changed, 7 insertions, 1 deletions
diff --git a/bash/bashrc b/bash/bashrc
index 94e0f7f7..4299b8b4 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -122,8 +122,14 @@ function prompt_vcs {
return $?
}
+# Function to return the number of backgrounded jobs.
+function prompt_jobs {
+ [[ -n "$(jobs)" ]] && echo -n "{$(jobs | wc -l | sed 's/ //g')}"
+ return $?
+}
+
# Uncolored bits of my prompt, we'll color them if appropriate shortly.
-PS1='[\u@\h:\w]$(prompt_vcs)\$'
+PS1='[\u@\h:\w]$(prompt_vcs)$(prompt_jobs)\$'
# Save some color codes based on our colour space.
if [[ $COLORS -ge 256 ]]; then