From 1c17acb758d6f07cad1d7f76f937271830482dec Mon Sep 17 00:00:00 2001 From: Clement Bourgeois Date: Fri, 29 Apr 2016 12:13:26 +0200 Subject: [PATCH] Fix incorrect background jobs number --- powerlevel9k.zsh-theme | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index d583eaab3..8fa3646fc 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -322,6 +322,10 @@ prompt_aws_eb_env() { set_default POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE true prompt_background_jobs() { local background_jobs_number=${$(jobs -l | wc -l)// /} + local wrong_lines=`jobs -l | awk '/pwd now/{ count++ } END {print count}'` + if [[ wrong_lines -gt 0 ]]; then + background_jobs_number=$(( $background_jobs_number - $wrong_lines )) + fi if [[ background_jobs_number -gt 0 ]]; then local background_jobs_number_print="" if [[ "$POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE" == "true" ]] && [[ "$background_jobs_number" -gt 1 ]]; then