From: Stefan Monnier <monnier+lists/zsh/workers/news/@TEQUILA.SYSTEMSZ.CS.YALE.EDU>
To: zsh-workers@math.gatech.edu
Subject: Re: multiple background jobs of the same program
Date: 14 Sep 1997 19:05:47 -0400 [thread overview]
Message-ID: <5liuw38pis.fsf@tequila.systemsz.cs.yale.edu> (raw)
In-Reply-To: <19970914150505.11879@sco.com>
"Adam R. Paul" <adamp@sco.com> 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
next parent reply other threads:[~1997-09-14 23:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <9709140326.AA21133@cryptica.UCSD.EDU>
[not found] ` <19970914102839.45957@sco.com>
[not found] ` <970914121042.ZM22784@candle.brasslantern.com>
[not found] ` <19970914150505.11879@sco.com>
1997-09-14 23:05 ` Stefan Monnier [this message]
[not found] ` <970914160910.ZM23900@candle.brasslantern.com>
[not found] ` <19970914200202.04363@sco.com>
1997-09-15 11:16 ` Stefan Monnier
1997-09-15 11:26 ` Stefan Monnier
[not found] ` <970915075634.ZM30556@candle.brasslantern.com>
1997-09-15 23:48 ` Stefan Monnier
1997-09-15 11:34 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5liuw38pis.fsf@tequila.systemsz.cs.yale.edu \
--to=monnier+lists/zsh/workers/news/@tequila.systemsz.cs.yale.edu \
--cc=zsh-workers@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).