From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9433 invoked from network); 14 Sep 1997 23:11:31 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 14 Sep 1997 23:11:31 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id TAA12166; Sun, 14 Sep 1997 19:05:31 -0400 (EDT) Resent-Date: Sun, 14 Sep 1997 19:05:31 -0400 (EDT) To: zsh-workers@math.gatech.edu Sender: monnier@TEQUILA.SYSTEMSZ.CS.YALE.EDU From: Stefan Monnier Newsgroups: lists.zsh.workers Subject: Re: multiple background jobs of the same program References: <9709140326.AA21133@cryptica.UCSD.EDU> <19970914102839.45957@sco.com> <970914121042.ZM22784@candle.brasslantern.com> <19970914150505.11879@sco.com> Date: 14 Sep 1997 19:05:47 -0400 Message-ID: <5liuw38pis.fsf@tequila.systemsz.cs.yale.edu> X-Newsreader: Gnus v5.5/Emacs 20.0 Path: tequila.systemsz.cs.yale.edu NNTP-Posting-Host: tequila.systemsz.cs.yale.edu Resent-Message-ID: <"p04Ac.0.1-2.ws67q"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3486 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu "Adam R. Paul" 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