mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-18 15:21:16 +02:00
zsh-workers:8515:fix
This commit is contained in:
parent
239a697e11
commit
5224d636bc
1 changed files with 27 additions and 0 deletions
27
Completion/Base/_jobs
Normal file
27
Completion/Base/_jobs
Normal file
|
@ -0,0 +1,27 @@
|
|||
#autoload
|
||||
|
||||
local expl disp jobs job jids
|
||||
|
||||
if [[ "$1" = -r ]]; then
|
||||
jids=( "${(@k)jobstates[(R)running*]}" )
|
||||
shift
|
||||
_description expl 'running job'
|
||||
elif [[ "$1" = -s ]]; then
|
||||
jids=( "${(@k)jobstates[(R)running*]}" )
|
||||
shift
|
||||
_description expl 'suspended job'
|
||||
else
|
||||
[[ "$1" = - ]] && shift
|
||||
jids=( "${(@k)jobtexts}" )
|
||||
_description expl job
|
||||
fi
|
||||
|
||||
disp=()
|
||||
jobs=()
|
||||
for job in "$jids[@]"; do
|
||||
disp=( "$disp[@]" "${(l:3:: ::%:)job} -- ${jobtexts[$job]}" )
|
||||
jobs=( "$jobs[@]" "$job" )
|
||||
done
|
||||
|
||||
compadd "$@" "$expl[@]" -ld disp - "%$^jobs[@]"
|
||||
|
Loading…
Reference in a new issue