zsh-workers
 help / color / mirror / code / Atom feed
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: 15 Sep 1997 07:16:41 -0400	[thread overview]
Message-ID: <5len6q9692.fsf@tequila.systemsz.cs.yale.edu> (raw)
In-Reply-To: <19970914200202.04363@sco.com>

"Adam R. Paul" <adamp@sco.com> writes:
> Thanks much again!  That's _almost_ perfect :)  The only remaining thing is
> that if a job is suspended due to tty output/input, the sed script doesn't
> quite do the right thing (the completion looks like:
> 
> fg %1 ;: tty output) vi foo
> 
> which then gives a parse error if you hit <return> due to the unmatched ')'.
> Oh well, no biggie:)

Good point, here is a version that should correctly ignore the "(tty input)"
thingie if present:

    complete_listjobs() {
      tmpfile=$TMP/zshjobcomp.$$
      jobs >| $tmpfile 2>&1
      if [[ -s $tmpfile ]] then
        reply=( "${(@f)$(sed -e '{
          s/suspended (tty [a-z]*put)/suspended/
          s/^\[\([0-9]*\)\][-+ ]*\([0-9]* *\)[a-z][a-z]*  *\(.*\)/%\1 ;: \2\3/
          }' $tmpfile)}" )
      else
        reply=()
      fi
    }
    
    compctl -Q -K complete_listjobs fg bg kill


-- Stefan


  parent reply	other threads:[~1997-09-15 11:27 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
     [not found]       ` <970914160910.ZM23900@candle.brasslantern.com>
     [not found]         ` <19970914200202.04363@sco.com>
1997-09-15 11:16           ` Stefan Monnier [this message]
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=5len6q9692.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).