Replace `jobs` with `jobs -p`

If some long shell code is run in the background it may be shown as more then 
one job:

    bash-4.2$ {
    > echo abc | while read line ; do
    > sleep 1s
    > sleep 1s
    > done
    > } &
    [1] 9401
    bash-4.2$ jobs
    [1]+  Running                 { echo abc | while read line; do
        sleep 1s; sleep 1s;
    done; } &

`jobs -p` print exactly one job in this case.
This commit is contained in:
ZyX 2014-01-19 16:19:23 +04:00
parent 1a841a4ac8
commit c6324afbc5
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ _powerline_tmux_set_columns() {
_powerline_prompt() {
local last_exit_code=$?
PS1="$($POWERLINE_COMMAND shell left -r bash_prompt --last_exit_code=$last_exit_code --jobnum="$(jobs|wc -l)")"
PS1="$($POWERLINE_COMMAND shell left -r bash_prompt --last_exit_code=$last_exit_code --jobnum="$(jobs -p|wc -l)")"
_powerline_tmux_set_pwd
return $last_exit_code
}