From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail12.digital.com (mail12.digital.com [192.208.46.20]) by math.gatech.edu (8.8.5/8.8.5) with ESMTP id IAA16752; Fri, 20 Mar 1998 08:14:40 -0500 (EST) Received: from muggsy.lkg.dec.com (muggsy.lkg.dec.com [16.20.32.219]) by mail12.digital.com (8.8.8/8.8.8/WV1.0c) with SMTP id IAA02550; Fri, 20 Mar 1998 08:13:57 -0500 (EST) Received: from jfcl.lkg.dec.com by muggsy.lkg.dec.com (5.65/DEC-Ultrix/4.3) with SMTP id AA09668; Fri, 20 Mar 1998 08:13:53 -0500 Received: by jfcl.lkg.dec.com (5.65/DEC-Ultrix/4.3) id AA07188; Fri, 20 Mar 1998 08:14:20 -0500 Received: by drkstr (5.65v3.2/1.1.10.5/06Mar97-0324PM) id AA06169; Fri, 20 Mar 1998 08:12:43 -0500 Date: Fri, 20 Mar 1998 08:12:43 -0500 Message-Id: <9803201312.AA06169@drkstr> From: Kevin Sullivan To: zsh-users@math.gatech.edu Cc: zsh-workers@math.gatech.edu Subject: Re: background jobs / feature request In-Reply-To: References: Timothy Luoma writes: > > Say I have several background jobs which I can see with jobs -l which are > either running in & mode or were control-Z'd into submission > > [1] 11381 running tail -1f /tmp/console.log > [2] - 11839 suspended ls --ignore=.dir.tiff --ignore=.opendir.tiff > --ignore=.dir3_0.wmd --classify | > 11840 suspended less > [3] + 11841 suspended find / -xdev -newer /etc/sendmail.cw -print > [4] 11767 suspended /usr/local/bin/pine -p > /Users/luomat/Unix/pine/pine.rc -sort arrival -f activ > > > > Now I want to get #2 back... is there any way that ZSH could be made to > understand > > fg \[2\] > > or, better > > fg 11839 > > ? > > This would be much more convenient, especially in the case of pine where I > have to type > > fg /usr/local/bin/pine > I use this. compctl -j -P '%' + -s '`ps x | tail +2 | cut -c1-5`' + \ -x 's[-] p[1]' -k "($signals[1,-3])" -- kill disown fg which allows me to tab through current jobs. I got the basis for this from someone, cann't remember who. It was originally designed for 'kill' only but I extended it for 'disown' and 'fg'. The nice thing about this particular aproach is I don't have to perform an extra command and muddy up my display. Kevin Sullivan