Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: multiple background jobs of the same program
- X-seq: zsh-workers 3489
- 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: 15 Sep 1997 07:16:41 -0400
- References: <9709140326.AA21133@xxxxxxxxxxxxxxxxx> <19970914102839.45957@xxxxxxx> <970914121042.ZM22784@xxxxxxxxxxxxxxxxxxxxxxx> <19970914150505.11879@xxxxxxx> <970914160910.ZM23900@xxxxxxxxxxxxxxxxxxxxxxx> <19970914200202.04363@xxxxxxx>
- Sender: monnier@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
"Adam R. Paul" <adamp@xxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author