diff options
| author | srdusr <trevorgray@srdusr.com> | 2023-05-18 22:33:21 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2023-05-18 22:33:21 +0200 |
| commit | 1f95337db3a62c373392a25c1941adaad745d608 (patch) | |
| tree | 872a5be99a09601b1e90f93278106970f3929ac8 /.config/zsh | |
| parent | b5da74458b600d333568bf204302876a7048dad5 (diff) | |
| download | dotfiles-1f95337db3a62c373392a25c1941adaad745d608.tar.gz dotfiles-1f95337db3a62c373392a25c1941adaad745d608.zip | |
Fixed Jobs indicator bug/behavior of jobs command inside of function
Diffstat (limited to '.config/zsh')
| -rw-r--r-- | .config/zsh/.zshrc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 27159da..2e46d49 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -72,11 +72,15 @@ git_branch_test_color() { # Job indicator jobs_status_indicator() { - local jobs_count=$(jobs | wc -l) - if [[ "$jobs_count" -gt 0 ]]; then + local jobs_output + declare -p jobs_output >/dev/null 2>&1 + if [[ $? -eq 0 ]]; then + unset jobs_output + fi + jobs_output=$(jobs -s) + if [[ -n "$jobs_output" ]]; then + local jobs_count=$(echo "$jobs_output" | wc -l) echo "jobs: ${jobs_count}" - else - echo "" fi } |
