Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: multiple background jobs of the same program
- X-seq: zsh-workers 3486
- From: Stefan Monnier <monnier+lists/zsh/workers/news/@TEQUILA.SYSTEMSZ.CS.YALE.EDU>
- To: zsh-workers@xxxxxxxxxxxxxxx
- Subject: Re: multiple background jobs of the same program
- Date: 14 Sep 1997 19:05:47 -0400
- References: <9709140326.AA21133@xxxxxxxxxxxxxxxxx> <19970914102839.45957@xxxxxxx> <970914121042.ZM22784@xxxxxxxxxxxxxxxxxxxxxxx> <19970914150505.11879@xxxxxxx>
- Sender: monnier@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
"Adam R. Paul" <adamp@xxxxxxx> writes:
> > listjobs() {
> > jobs >| /tmp/._zshjobcomp.$$ 2>&1
> > reply=( "${(@f)$(sed -e '{
> > s/.\(....\).............\(.*\)/%\1 ;: \2/g
> > s/\]//g
> > s/ */ /g
> > }' /tmp/._zshjobcomp.$$)}" )
> > }
> >
> > compctl -U -Q -K listjobs fg bg kill
>
> Thanks very much! Now if I can only get it to work without having
> menu_complete set, I'll be one happier camper ;-)
I don't like menu_complete either, but it seems that dropping the -U
is enough to make it work in my case (I have about zero knowledge of the
compctl command). One other thing is: I have "jobs" aliased to "jobs -l"
(why would anyone not see the PIDs is beyond me), so I've had to tweak the
regexp. I've seriously tightened it and in the end it looks like this (it
should work whether your "jobs" is aliased to "jobs -l" or not):
complete_listjobs() {
jobs >| $TMP/zshjobcomp.$$ 2>&1
reply=( "${(@f)$(sed -e '{
s/^\[\([0-9][0-9]*\)\] *[-+ ] *\([0-9]* \)[a-z][a-z]* *\(.*\)/%\1 ;: \2\3/
}' $TMP/zshjobcomp.$$)}" )
}
compctl -Q -K complete_listjobs fg bg kill
Stefan
Messages sorted by:
Reverse Date,
Date,
Thread,
Author