aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/prompt.bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash/bashrc.d/prompt.bash')
-rw-r--r--bash/bashrc.d/prompt.bash8
1 files changed, 6 insertions, 2 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 6ecf44ba..8927e732 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -168,8 +168,12 @@ prompt() {
# Show the count of background jobs in curly brackets
job)
- if [[ $(jobs) ]]; then
- printf '{%d}' "$(jobs | sed -n '$=')"
+ local jobc=0
+ while read -r line; do
+ ((jobc++))
+ done < <(jobs)
+ if ((jobc > 0)); then
+ printf '{%d}' "$jobc"
fi
;;
esac