Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: A job signaller
- X-seq: zsh-users 1895
- From: Dan Nelson <dnelson@xxxxxxxxxxxx>
- To: Zefram <zefram@xxxxxxxxx>, pumilia@xxxxxx
- Subject: Re: A job signaller
- Date: Thu, 29 Oct 1998 12:19:53 -0600
- Cc: zsh-users@xxxxxxxxxxxxxxx
- In-reply-to: <199810291358.NAA23600@xxxxxxxxxxxxxxxxx>; from "Zefram" on Thu Oct 29 13:58:23 GMT 1998
- References: <19981029143654.A4064@xxxxxxxxxxxxxxx> <199810291358.NAA23600@xxxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author