From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6722 invoked from network); 29 Oct 1998 18:36:55 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 29 Oct 1998 18:36:55 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id NAA18218; Thu, 29 Oct 1998 13:17:38 -0500 (EST) Resent-Date: Thu, 29 Oct 1998 13:17:31 -0500 (EST) Date: Thu, 29 Oct 1998 12:19:53 -0600 From: Dan Nelson To: Zefram , pumilia@est.it Cc: zsh-users@math.gatech.edu Subject: Re: A job signaller Message-ID: <19981029121953.A7145@emsphone.com> References: <19981029143654.A4064@wigner.cstc.org> <199810291358.NAA23600@diamond.tao.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.94.3i In-Reply-To: <199810291358.NAA23600@diamond.tao.co.uk>; from "Zefram" on Thu Oct 29 13:58:23 GMT 1998 X-OS: FreeBSD 2.2.7-STABLE Resent-Message-ID: <"BS0PQ.0.AS4.w4BEs"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1895 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu In the last episode (Oct 29), Zefram said: > Paolo Pumilia wrote: > >Is there a way to put a mark within the prompt string to > >inform the user that jobs are still running from that shell? > >(e.g +/-: "+" for running or stopped jobs; "-" for no jobs) > > I use something like this: > > precmd () { > if jobs % >& /dev/null; then > psvar=("") > else > psvar=() > fi > } > PS1="%(1v:+:-)> " Note that a side-effect of this is that an "exit" will not warn you that you have jobs running. The "jobs" comand in the precmd() function clears the variable that would cause the warning to be printed. -Dan Nelson dnelson@emsphone.com