Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: A job signaller



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:+:-)> "

-zefram



Messages sorted by: Reverse Date, Date, Thread, Author